Skip to main content

Uninit

Struct Uninit 

Source
pub struct Uninit<B> { /* private fields */ }
Available on crate feature std only.
Expand description

A read-target view of a buffer’s writable spare [buf_len, capacity): reading into it appends to the underlying (the view’s offset 0 is the underlying’s buf_len). Created by IoBufMut::uninit; recover the buffer with into_inner.

Implementations§

Source§

impl<B> Uninit<B>

Source

pub fn into_inner(self) -> B

Recover the underlying buffer, with whatever was read into the spare now part of its initialized region.

Trait Implementations§

Source§

impl<B: Debug> Debug for Uninit<B>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<B: IoBuf> IoBuf for Uninit<B>

Source§

fn as_init(&self) -> &[u8]

The initialized (readable / already-written) bytes. Read more
Source§

fn buf_len(&self) -> usize

Number of initialized bytes (as_init().len()).
Source§

fn buf_ptr(&self) -> *const u8

Raw const pointer to the start of the initialized region: for handing an address to a kernel/FFI sink (io_uring SEND_ZC, a TLS BIO). Most code should prefer as_init. Read more
Source§

fn slice(self, range: impl RangeBounds<usize>) -> Slice<Self>
where Self: Sized,

Restrict this buffer to the sub-range [begin, end), consuming it. Read more
Source§

impl<B: IoBufMut> IoBufMut for Uninit<B>

Source§

fn as_uninit(&mut self) -> &mut [MaybeUninit<u8>]

The full backing storage as possibly-uninitialized bytes: the initialized prefix [0, buf_len) plus the writable spare [buf_len, capacity). Read more
Source§

fn buf_capacity(&mut self) -> usize

Total capacity (as_uninit().len()).
Source§

fn buf_mut_ptr(&mut self) -> *mut u8

Raw mutable pointer to the start of the backing storage: for a kernel/FFI read target (io_uring recv). Most code should prefer spare_mut. Read more
Source§

fn spare_mut(&mut self) -> &mut [MaybeUninit<u8>]

The writable spare tail [buf_len, capacity) — the read destination.
Source§

fn as_mut_slice(&mut self) -> &mut [u8]

The initialized region [0, buf_len) as a mutable slice, for an in-place transform (e.g. decrypting a TLS record inside the very buffer it arrived in, no copy).
Source§

fn uninit(self) -> Uninit<Self>
where Self: Sized,

A read-target view of just the writable spare [buf_len, capacity). Read more
Source§

impl<B: SetLen + IoBuf> SetLen for Uninit<B>

Source§

unsafe fn set_len(&mut self, len: usize)

Set the initialized length to len. Read more

Auto Trait Implementations§

§

impl<B> Freeze for Uninit<B>
where B: Freeze,

§

impl<B> RefUnwindSafe for Uninit<B>
where B: RefUnwindSafe,

§

impl<B> Send for Uninit<B>
where B: Send,

§

impl<B> Sync for Uninit<B>
where B: Sync,

§

impl<B> Unpin for Uninit<B>
where B: Unpin,

§

impl<B> UnsafeUnpin for Uninit<B>
where B: UnsafeUnpin,

§

impl<B> UnwindSafe for Uninit<B>
where B: UnwindSafe,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> RamaFrom<T> for U
where U: From<T>,

Source§

fn rama_from(value: T) -> U

Source§

impl<T, U, CrateMarker> RamaInto<U, CrateMarker> for T
where U: RamaFrom<T, CrateMarker>,

Source§

fn rama_into(self) -> U

Source§

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

Source§

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

Source§

fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>

Source§

impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for T
where U: RamaTryFrom<T, CrateMarker>,

Source§

type Error = <U as RamaTryFrom<T, CrateMarker>>::Error

Source§

fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<V, F> ValueFormatter<&V> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

Source§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
Source§

fn format_value(writer: impl ValueWriter, value: &&V)

Write value to writer
Source§

impl<V, F> ValueFormatter<Arc<V>> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

Source§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
Source§

fn format_value(writer: impl ValueWriter, value: &Arc<V>)

Write value to writer
Source§

impl<V, F> ValueFormatter<Box<V>> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

Source§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
Source§

fn format_value(writer: impl ValueWriter, value: &Box<V>)

Write value to writer
Source§

impl<V, F> ValueFormatter<Cow<'_, V>> for F
where V: ToOwned + ?Sized, F: ValueFormatter<V> + ?Sized,

Source§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
Source§

fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)

Write value to writer
Source§

impl<V, F> ValueFormatter<Option<V>> for F
where F: ValueFormatter<V> + ?Sized,

Source§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
Source§

fn format_value(writer: impl ValueWriter, value: &Option<V>)

Write value to writer
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more