pub struct File<T = TokioTcpTransport> { /* private fields */ }Expand description
One open file handle on a tree-connected share.
Implementations§
Source§impl<T> File<T>where
T: SmbTransport + Send,
impl<T> File<T>where
T: SmbTransport + Send,
Sourcepub fn durable_handle(&self) -> Option<&DurableHandle>
pub fn durable_handle(&self) -> Option<&DurableHandle>
Returns the durable reconnect state captured for this file, if requested.
Sourcepub fn resilient_handle(&self) -> Option<ResilientHandle>
pub fn resilient_handle(&self) -> Option<ResilientHandle>
Returns the resiliency state captured for this file, if requested.
Sourcepub fn connection(&self) -> &Connection<T, TreeConnected>
pub fn connection(&self) -> &Connection<T, TreeConnected>
Returns the wrapped tree-connected connection.
Sourcepub fn connection_mut(&mut self) -> &mut Connection<T, TreeConnected>
pub fn connection_mut(&mut self) -> &mut Connection<T, TreeConnected>
Returns a mutable reference to the wrapped tree-connected connection.
Sourcepub async fn read_all(&mut self) -> Result<Vec<u8>, CoreError>
pub async fn read_all(&mut self) -> Result<Vec<u8>, CoreError>
Reads the full contents of the open file.
Sourcepub async fn read_to_end(&mut self) -> Result<Vec<u8>, CoreError>
pub async fn read_to_end(&mut self) -> Result<Vec<u8>, CoreError>
Reads the full contents of the open file.
This is an alias for File::read_all that matches the standard async
I/O naming convention used by Rust callers.
Sourcepub async fn write_all(&mut self, data: &[u8]) -> Result<(), CoreError>
pub async fn write_all(&mut self, data: &[u8]) -> Result<(), CoreError>
Writes the full provided buffer to the open file starting at offset zero.
Sourcepub async fn sync_all(&mut self) -> Result<(), CoreError>
pub async fn sync_all(&mut self) -> Result<(), CoreError>
Flushes all buffered SMB state for the open file handle.
This is an alias for File::flush that matches common filesystem
terminology used by embedders.
Sourcepub async fn stat(&mut self) -> Result<FileMetadata, CoreError>
pub async fn stat(&mut self) -> Result<FileMetadata, CoreError>
Queries metadata for the open file handle.
Sourcepub async fn request_resiliency(
&mut self,
timeout: u32,
) -> Result<ResilientHandle, CoreError>
pub async fn request_resiliency( &mut self, timeout: u32, ) -> Result<ResilientHandle, CoreError>
Requests handle resiliency for the current file and stores the result for future reconnects.
Sourcepub async fn close(self) -> Result<Share<T>, CoreError>
pub async fn close(self) -> Result<Share<T>, CoreError>
Closes the file and returns the tree-connected share wrapper.
Sourcepub fn into_parts(
self,
) -> (Share<T>, FileId, Option<DurableHandle>, Option<ResilientHandle>)
pub fn into_parts( self, ) -> (Share<T>, FileId, Option<DurableHandle>, Option<ResilientHandle>)
Consumes the file wrapper and returns the share wrapper plus low-level file state.