Skip to main content

HeaderSlice

Struct HeaderSlice 

Source
pub struct HeaderSlice<H, T> {
    pub header: H,
    /* private fields */
}
Expand description

Structure to allow Arc-managing some fixed-sized data and a variably-sized slice in a single allocation.

cbindgen:derive-eq=false cbindgen:derive-neq=false

Fields§

§header: H

The fixed-sized data.

Implementations§

Source§

impl<H, T> HeaderSlice<H, T>

Source

pub fn slice(&self) -> &[T]

Returns the dynamically sized slice in this HeaderSlice.

Source

pub fn slice_mut(&mut self) -> &mut [T]

Returns the dynamically sized slice in this HeaderSlice.

Source

pub fn len(&self) -> usize

Returns the len of the slice.

Source

pub fn is_empty(&self) -> bool

Returns whether the slice is empty.

Trait Implementations§

Source§

impl<H: Debug, T: Debug> Debug for HeaderSlice<H, T>

Source§

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

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

impl<H, T> Drop for HeaderSlice<H, T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<H: Eq, T: Eq> Eq for HeaderSlice<H, T>

Source§

impl<H: PartialEq, T: PartialEq> PartialEq for HeaderSlice<H, T>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl<H, T> Freeze for HeaderSlice<H, T>
where H: Freeze, [T; 0]: Freeze,

§

impl<H, T> RefUnwindSafe for HeaderSlice<H, T>

§

impl<H, T> Send for HeaderSlice<H, T>
where H: Send, [T; 0]: Send,

§

impl<H, T> Sync for HeaderSlice<H, T>
where H: Sync, [T; 0]: Sync,

§

impl<H, T> Unpin for HeaderSlice<H, T>
where H: Unpin, [T; 0]: Unpin,

§

impl<H, T> UnsafeUnpin for HeaderSlice<H, T>

§

impl<H, T> UnwindSafe for HeaderSlice<H, T>

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 = !

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.