pub struct SessionFileStore { /* private fields */ }Expand description
Protected immutable file storage shared by inbound and outbound transports.
Display names live only in metadata; payloads always use an internal filename.
Implementations§
Source§impl SessionFileStore
impl SessionFileStore
Sourcepub fn new(state_dir: &Path) -> Self
pub fn new(state_dir: &Path) -> Self
Creates a store below the gateway’s already protected state directory.
Sourcepub async fn begin_upload(
&self,
session_id: &str,
name: String,
size: u64,
media_type: String,
) -> Result<PendingSessionFileWrite>
pub async fn begin_upload( &self, session_id: &str, name: String, size: u64, media_type: String, ) -> Result<PendingSessionFileWrite>
Starts one connection-owned user upload.
Sourcepub async fn publish_artifact(
&self,
session_id: &str,
name: String,
media_type: String,
bytes: &[u8],
) -> Result<SessionFileReference>
pub async fn publish_artifact( &self, session_id: &str, name: String, media_type: String, bytes: &[u8], ) -> Result<SessionFileReference>
Publishes one immutable agent artifact.
Sourcepub async fn list_uploads(
&self,
session_id: &str,
) -> Result<Vec<SessionFileReference>>
pub async fn list_uploads( &self, session_id: &str, ) -> Result<Vec<SessionFileReference>>
Lists completed user uploads for one session.
Sourcepub async fn list_artifacts(
&self,
session_id: &str,
) -> Result<Vec<SessionFileReference>>
pub async fn list_artifacts( &self, session_id: &str, ) -> Result<Vec<SessionFileReference>>
Lists completed agent artifacts for one session.
Sourcepub async fn delete_session(&self, session_id: &str) -> Result<()>
pub async fn delete_session(&self, session_id: &str) -> Result<()>
Permanently removes every upload and artifact owned by one idle session.
Sourcepub async fn read_chunk(
&self,
session_id: &str,
file_id: &str,
offset: u64,
max_bytes: usize,
) -> Result<SessionFileChunk>
pub async fn read_chunk( &self, session_id: &str, file_id: &str, offset: u64, max_bytes: usize, ) -> Result<SessionFileChunk>
Reads one bounded byte range from either kind of stored session file.
Sourcepub async fn read_upload_all(
&self,
session_id: &str,
expected: &SessionFileReference,
) -> Result<(SessionFileReference, Vec<u8>)>
pub async fn read_upload_all( &self, session_id: &str, expected: &SessionFileReference, ) -> Result<(SessionFileReference, Vec<u8>)>
Reads and validates one complete user upload for model input.
Sourcepub async fn verify_upload(
&self,
session_id: &str,
expected: &SessionFileReference,
) -> Result<()>
pub async fn verify_upload( &self, session_id: &str, expected: &SessionFileReference, ) -> Result<()>
Verifies that a frontend reference names the exact user upload.
Trait Implementations§
Source§impl Clone for SessionFileStore
impl Clone for SessionFileStore
Source§fn clone(&self) -> SessionFileStore
fn clone(&self) -> SessionFileStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SessionFileStore
impl !UnwindSafe for SessionFileStore
impl Freeze for SessionFileStore
impl Send for SessionFileStore
impl Sync for SessionFileStore
impl Unpin for SessionFileStore
impl UnsafeUnpin for SessionFileStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more