Struct Slice

Source
pub struct Slice {
    pub len: usize,
}
Expand description

Meta data for a slice

Fields§

§len: usize

Number of elements in the slice

Trait Implementations§

Source§

impl Clone for Slice

Source§

fn clone(&self) -> Slice

Returns a copy 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 Debug for Slice

Source§

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

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

impl PartialEq for Slice

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Slice

Source§

impl Eq for Slice

Source§

impl StructuralPartialEq for Slice

Auto Trait Implementations§

§

impl Freeze for Slice

§

impl RefUnwindSafe for Slice

§

impl Send for Slice

§

impl Sync for Slice

§

impl Unpin for Slice

§

impl UnwindSafe for Slice

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

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

Source§

default fn meta(self: *const T) -> <T as Type>::Meta

Retrieve TraitObject, Slice or Concrete meta data respectively for a type
Source§

default fn data(self: *const T) -> *const ()

Retrieve pointer to the data
Source§

default fn data_mut(self: *mut T) -> *mut ()

Retrieve mut pointer to the data
Source§

default fn dangling(t: <T as Type>::Meta) -> NonNull<T>

Create a dangling non-null *const Self with the provided Self::Meta.
Source§

default fn fatten(thin: *mut (), t: <T as Type>::Meta) -> *mut T

Create a *mut Self with the provided Self::Meta.
Source§

const METATYPE: MetaType

Enum describing whether a type is TraitObject, Slice or Concrete.
Source§

type Meta: 'static

Type of metadata for type.
Source§

fn meta_type(self: *const Self) -> MetaType

Helper method describing whether a type is TraitObject, Slice or Concrete.
Source§

impl<T> Type for T

Source§

fn meta_type(self: *const Self) -> MetaType

Helper method describing whether a type is TraitObject, Slice or Concrete.