[][src]Struct abi_stable::type_layout::StartLen

#[repr(transparent)]
pub struct StartLen { /* fields omitted */ }

The start and length of a slice into TLFunctions.

Methods

impl StartLen[src]

pub const fn new(start: u16, len: u16) -> Self[src]

Constructs a range.

pub const fn start(self) -> u16[src]

Gets the start of the range.

pub const fn len(self) -> u16[src]

Gets the length of the range.

pub const fn start_usize(self) -> usize[src]

Gets the start of the range as a usize.

pub const fn len_usize(self) -> usize[src]

Gets the length of the range as a usize.

pub const fn end_usize(self) -> usize[src]

Gets the exclusive end of the range as a usize.

pub const fn to_range(self) -> Range<usize>[src]

Converts this range to a std::ops::Range.

pub const fn from_u32(n: StartLenRepr) -> Self[src]

Constructs this StartLen from its internal representation.

pub const EMPTY: Self[src]

An empty range.

pub const BIT_SIZE: u32

The ammount of bits used to represent a StartLen

pub const fn end(self) -> usize

The exclusive end of this range.

pub const fn from_u26(n: u32) -> Self

Constructs a StartLen from a bitfield encoded as (start:16 bits) + (length: 10 bits) .

pub const fn to_u26(self) -> u32

Converts this StartLen to bitfields encoded as (start:16 bits) + (length: 10 bits) .

Trait Implementations

impl Clone for StartLen[src]

impl Copy for StartLen[src]

impl Debug for StartLen[src]

impl Eq for StartLen[src]

impl GetStaticEquivalent_ for StartLen[src]

type StaticEquivalent = _static_StartLen

impl Ord for StartLen[src]

impl PartialEq<StartLen> for StartLen[src]

impl PartialOrd<StartLen> for StartLen[src]

impl SharedStableAbi for StartLen[src]

type IsNonZeroType = <u32 as __SharedStableAbi>::IsNonZeroType

Whether this type has a single invalid bit-pattern. Read more

type Kind = __ValueKind

The kind of abi stability of this type,there are 2: Read more

impl StructuralEq for StartLen[src]

impl StructuralPartialEq for StartLen[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> BorrowOwned<'a> for T where
    T: 'a + Clone
[src]

type ROwned = T

type RBorrowed = &'a T

impl<T> From<T> for T[src]

impl<This> GetConstGenericVTable for This where
    This: StableAbi + Eq + PartialEq<This> + Debug + Send + Sync
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SelfOps for T where
    T: ?Sized
[src]

impl<This> StableAbi for This where
    This: SharedStableAbi<Kind = ValueKind>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<This> TransmuteElement for This where
    This: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The error type returned when the conversion fails.

impl<T> TypeIdentity for T where
    T: ?Sized
[src]

type Type = T

The same type as Self. Read more