pub struct Sendfile<O: FileOpener + Send + 'static> { /* private fields */ }
Expand description
A structure that tracks progress of sending a file
Implementations§
Source§impl<O: FileOpener> Sendfile<O>
impl<O: FileOpener> Sendfile<O>
Sourcepub fn size(&self) -> u64
pub fn size(&self) -> u64
Returns full size of the file
Note that if file changes while we are reading it, we may not be
able to send this number of bytes. In this case we will return
WriteZero
error however.
Sourcepub fn write_into<D: Destination>(self, dest: D) -> WriteFile<O, D>
pub fn write_into<D: Destination>(self, dest: D) -> WriteFile<O, D>
Returns a future which resolves to original socket when file has been written into a file
Auto Trait Implementations§
impl<O> Freeze for Sendfile<O>where
O: Freeze,
impl<O> RefUnwindSafe for Sendfile<O>where
O: RefUnwindSafe,
impl<O> Send for Sendfile<O>
impl<O> Sync for Sendfile<O>where
O: Sync,
impl<O> Unpin for Sendfile<O>where
O: Unpin,
impl<O> UnwindSafe for Sendfile<O>where
O: UnwindSafe,
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