[][src]Struct sendfile::SendFile

pub struct SendFile<F, S> { /* fields omitted */ }

Wrapper around the sendfile system call.

From the sendfile manual ($ man sendfile 2):

sendfile copies data between one file descriptor and another. Because this copying is done within the kernel, sendfile is more efficient than the combination of read and write, which would require transferring data to and from user space.

Platform support

Notes

The Future implementation doesn't implement waking, it is up to the caller to ensure future is polled again once the socket is ready to receive more data.

Methods

impl<F, S> SendFile<F, S>[src]

pub fn into_inner(self) -> (F, S)[src]

Retrieve the file and socket.

pub fn written(&self) -> usize[src]

Returns the number of bytes written.

Trait Implementations

impl<F: Debug, S: Debug> Debug for SendFile<F, S>[src]

impl<F, S> Future for SendFile<F, S> where
    F: AsRawFd + Unpin,
    S: AsRawFd + Unpin
[src]

type Output = Result<()>

The number of bytes written, or an I/O error.

Auto Trait Implementations

impl<F, S> Sync for SendFile<F, S> where
    F: Sync,
    S: Sync

impl<F, S> Send for SendFile<F, S> where
    F: Send,
    S: Send

impl<F, S> Unpin for SendFile<F, S> where
    F: Unpin,
    S: Unpin

impl<F, S> RefUnwindSafe for SendFile<F, S> where
    F: RefUnwindSafe,
    S: RefUnwindSafe

impl<F, S> UnwindSafe for SendFile<F, S> where
    F: UnwindSafe,
    S: UnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]