Skip to main content

TransportByteSink

Struct TransportByteSink 

Source
pub struct TransportByteSink<'a, T: ?Sized>(/* private fields */);
Expand description

Zero-copy core byte-sink adapter over a transport-owned writable port.

Implementations§

Source§

impl<'a, T: ?Sized> TransportByteSink<'a, T>

Source

pub const fn new(sink: &'a mut T) -> Self

Borrow a transport-writable port without copying or coalescing its bytes.

Source

pub fn into_inner(self) -> &'a mut T

Recover the wrapped transport port.

Trait Implementations§

Source§

impl<T: WritableBytes + ?Sized> ByteSink for TransportByteSink<'_, T>

Source§

fn len(&self) -> u64

Stable logical length of this destination.
Source§

fn write_at(&mut self, offset: u64, source: &[u8]) -> Result<(), BackendError>

Write source to the exact logical range beginning at offset.
Source§

fn as_contiguous_mut(&mut self) -> Option<&mut [u8]>

Mutably borrow the complete logical destination when it is one contiguous region. Read more
Source§

fn is_empty(&self) -> bool

Source§

impl<'a, T: Debug + ?Sized> Debug for TransportByteSink<'a, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, T> !UnwindSafe for TransportByteSink<'a, T>

§

impl<'a, T> Freeze for TransportByteSink<'a, T>
where T: ?Sized,

§

impl<'a, T> RefUnwindSafe for TransportByteSink<'a, T>
where T: RefUnwindSafe + ?Sized,

§

impl<'a, T> Send for TransportByteSink<'a, T>
where T: Send + ?Sized,

§

impl<'a, T> Sync for TransportByteSink<'a, T>
where T: Sync + ?Sized,

§

impl<'a, T> Unpin for TransportByteSink<'a, T>
where T: ?Sized,

§

impl<'a, T> UnsafeUnpin for TransportByteSink<'a, T>
where T: ?Sized,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.