Skip to main content

Ints

Enum Ints 

Source
pub enum Ints<'a> {
    Run(&'a PrimArray, &'a Meter),
    Items(&'a [Value], &'static str, &'a Meter),
    Raw(&'a [u8], &'a Meter),
}
Expand description

A list of integers: a primitive run, or a list or tuple of ints.

Variants§

§

Run(&'a PrimArray, &'a Meter)

A primitive run.

§

Items(&'a [Value], &'static str, &'a Meter)

A list or tuple of values, each checked as it is read.

§

Raw(&'a [u8], &'a Meter)

bytes (TypelessData), which bytes() copies as it is.

Implementations§

Source§

impl<'a> Ints<'a>

Source

pub fn len(&self) -> usize

The number of integers.

Source

pub fn is_empty(&self) -> bool

Whether there are no integers.

Source

pub fn byte(&self, i: usize) -> Result<u8, MeshError>

Element i of bytes(self): the value, which must be a byte (ValueError “bytes must be in range(0, 256)” otherwise; a bool is its int). i past the end reads as 0.

Source

pub fn item(&self, i: usize) -> Result<Option<u8>, MeshError>

Item i as m_Data[i] reads it (helpers/PackedBitVector.py:56): None past the end, where Python raises IndexError; a value that is no byte, which no typetree’s UInt8 holds, is Malformed.

Source

pub fn is_bytes(&self) -> bool

Whether Python holds it as bytes, whose index error reads “index out of range”, not a list’s.

Source

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

The bytes themselves, where they need no check (a U8 run, or bytes).

Trait Implementations§

Source§

impl<'a> Clone for Ints<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Ints<'a>

Source§

impl<'a> Debug for Ints<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Ints<'a>

§

impl<'a> !UnwindSafe for Ints<'a>

§

impl<'a> Forget for Ints<'a>

§

impl<'a> Freeze for Ints<'a>

§

impl<'a> Move for Ints<'a>

§

impl<'a> Send for Ints<'a>

§

impl<'a> Sync for Ints<'a>

§

impl<'a> Unpin for Ints<'a>

§

impl<'a> UnsafeUnpin for Ints<'a>

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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.