Struct Const

Source
pub struct Const { /* private fields */ }

Implementations§

Source§

impl Const

Source

pub unsafe fn new(ptr: *const u8, len: usize) -> Self

Source

pub unsafe fn cast_to_ref<'a, T>(self) -> &'a T

Source

pub unsafe fn from_slice(slice: &[u8]) -> Self

Source

pub fn slice<'a>(self) -> &'a [u8]

Source

pub unsafe fn array<'a, const L: usize>(self) -> &'a [u8; L]

Source

pub fn copy_to(self, dst: Mut)

Trait Implementations§

Source§

impl Clone for Const

Source§

fn clone(&self) -> Const

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Decode for Const

Source§

fn decode(buf: BufConst<Self>) -> (Self, usize)

Source§

impl<'a> From<Const> for &'a [u8]

Source§

fn from(value: Const) -> Self

Converts to this type from the input type.
Source§

impl Index<usize> for Const

Source§

type Output = u8

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Instance for Const

Source§

unsafe fn range_at(self, at: usize, len: usize) -> Self

Source§

unsafe fn range(self, start: usize, end: usize) -> Self

Source§

unsafe fn range_from(self, start: usize) -> Self

Source§

fn to_const(self) -> Const

Source§

fn len(self) -> usize

Source§

impl Instance for Const

Source§

type Buf<P: Ptr> = BytesPtrConstBuf<P>

Source§

unsafe fn buf<P: Ptr>(ptr: P) -> Self::Buf<P>

Source§

fn buf_ptr<P: Ptr>(buf: Self::Buf<P>) -> P

Source§

impl Instance for Const

Source§

fn len(&self) -> usize

Source§

fn buf_len(buf: BufConst<Self>) -> usize

Source§

fn encode(&self, buf: BufMut<Self>) -> usize

Source§

impl<P: Ptr> Readable<Const> for BytesPtrConstBuf<P>

Source§

fn write_to(self, buf: BufMut<Const>) -> usize

Source§

fn len(&self) -> usize

Source§

impl Copy for Const

Auto Trait Implementations§

§

impl Freeze for Const

§

impl RefUnwindSafe for Const

§

impl !Send for Const

§

impl !Sync for Const

§

impl Unpin for Const

§

impl UnwindSafe for Const

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.