Skip to main content

SendBuilder

Struct SendBuilder 

Source
pub struct SendBuilder<R: AsFd, H> { /* private fields */ }
Expand description

Builds a send stream.

Implementations§

Source§

impl<H> SendBuilder<OwnedFd, H>

Source

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>

Construes a new builder from a given path.

Source§

impl<R, H> SendBuilder<R, H>
where H: StreamHandler + Send + 'static, R: AsFd + Send + 'static,

Source

pub fn new(source: R) -> Self

Construes a new builder.

Source

pub fn version(self, version: u32) -> Self

Set the send stream version.

By default the highest supported version if used.

Source

pub fn handler(self, handler: H) -> Self

Use the given handler to receive the stream.

Source

pub fn buffered(self, buffered: bool) -> Self

Wether or not to use a buffered receive.

This options has no effect if no handler is provided.

See, super::receive_stream() for more information.

Source

pub fn no_file_data(self, no_file_data: bool) -> Self

File data wont be included in the stream.

Write commands will be replaced with Update Extent commands.

Source

pub fn omit_end_cmd(self, omit_end_cmd: bool) -> Self

Omit the command at the end of the stream.

Source

pub fn omit_stream_header(self, omit_stream_header: bool) -> Self

Omit the stream header.

Source

pub fn compressed(self, compressed: bool) -> Self

Send compressed data.

Source

pub fn spawn_send(self) -> Result<SendHandle>

Consumes the builder and spawns a non blocking send.

Source

pub fn blocking_send(self) -> Result<()>

Consumes the builder and performs a blocking send.

Trait Implementations§

Source§

impl<R: AsFd, H> From<R> for SendBuilder<R, H>

Source§

fn from(source: R) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<R, H> Freeze for SendBuilder<R, H>
where R: Freeze, Option<H>: Freeze,

§

impl<R, H> RefUnwindSafe for SendBuilder<R, H>

§

impl<R, H> Send for SendBuilder<R, H>
where R: Send, Option<H>: Send,

§

impl<R, H> Sync for SendBuilder<R, H>
where R: Sync, Option<H>: Sync,

§

impl<R, H> Unpin for SendBuilder<R, H>
where R: Unpin, Option<H>: Unpin,

§

impl<R, H> UnsafeUnpin for SendBuilder<R, H>

§

impl<R, H> UnwindSafe for SendBuilder<R, H>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.