Trait tk_sendfile::Destination [] [src]

pub trait Destination: Write + Send {
    fn write_file<O: FileOpener>(&mut self,
                             file: &mut Sendfile<O>)
                             -> Result<usize, Error>; fn poll_write(&mut self) -> Async<()>; }

A trait that represents anything that file can be sent to

The trait is implemented for TcpStream right away but you might want to implement your own thing, for example to prepend the data with file length header

Required Methods

This method does the actual sendfile call

Note: this method is called in other thread

Test to see if this object may be writable

Implementors