Skip to main content

Stream

Trait Stream 

Source
pub trait Stream:
    Read
    + Write
    + Send
    + Sync {
    // Required methods
    fn clone_box(&self) -> Box<dyn Stream>;
    fn try_clone_to_owned(&self) -> Result<OwnedFd, Error>;
    fn try_borrow_as_fd(&self) -> Result<BorrowedFd<'_>, Error>;
}
Expand description

A trait representing a stream that can be read from and written to. This is used for custom stream implementations in OpenFile.

Types that implement this trait are expected to be cloneable via the clone_box function.

Required Methods§

Source

fn clone_box(&self) -> Box<dyn Stream>

Clones the stream into a boxed trait object.

Source

fn try_clone_to_owned(&self) -> Result<OwnedFd, Error>

Converts the stream into an OwnedFd. Returns an error if the operation is not supported or if it fails.

Source

fn try_borrow_as_fd(&self) -> Result<BorrowedFd<'_>, Error>

Borrows the stream as a BorrowedFd. Returns an error if the operation is not supported or if it fails.

Implementors§