Struct Seq0255

Source
#[repr(C)]
pub struct Seq0255<'a, T>(pub Vec<T>, _);
Expand description

Seq0255 represents a sequence with a maximum length of 255 elements. This structure uses a generic type T and a lifetime parameter 'a.

Tuple Fields§

§0: Vec<T>

Implementations§

Source§

impl<'a, const SIZE: usize, const HEADERSIZE: usize, const MAXSIZE: usize> Seq0255<'a, Inner<'a, false, SIZE, HEADERSIZE, MAXSIZE>>

Source

pub fn to_vec(&self) -> Vec<Vec<u8>>

Converts the inner types to owned vector, and collects.

Source

pub fn inner_as_ref(&self) -> Vec<&[u8]>

Converts the inner types to shared reference, and collects.

Source§

impl<'a, const SIZE: usize> Seq0255<'a, Inner<'a, true, SIZE, 0, 0>>

Source

pub fn to_vec(&self) -> Vec<Vec<u8>>

Converts the inner types to owned vector, and collects.

Source

pub fn inner_as_ref(&self) -> Vec<&[u8]>

Converts the inner types to shared reference, and collects.

Source§

impl<'a, T: 'a> Seq0255<'a, T>

Source

pub fn new(inner: Vec<T>) -> Result<Self, Error>

Creates a new Seq0255 instance with the given inner vector.

Source

pub fn into_inner(self) -> Vec<T>

Consumes the Seq0255 and returns the inner vector of elements.

Source§

impl<T: Fixed> Seq0255<'_, T>

Source

pub fn into_static(self) -> Seq0255<'static, T>

converts the lifetime to static

Source§

impl<'a, const ISFIXED: bool, const SIZE: usize, const HEADERSIZE: usize, const MAXSIZE: usize> Seq0255<'a, Inner<'a, ISFIXED, SIZE, HEADERSIZE, MAXSIZE>>

Source

pub fn into_static( self, ) -> Seq0255<'static, Inner<'static, ISFIXED, SIZE, HEADERSIZE, MAXSIZE>>

converts the lifetime to static

Trait Implementations§

Source§

impl<'a, T: Clone> Clone for Seq0255<'a, T>

Source§

fn clone(&self) -> Seq0255<'a, T>

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<'a, T: Debug> Debug for Seq0255<'a, T>

Source§

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

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

impl<'a, T: 'a + Sv2DataType<'a> + GetMarker + GetSize + Decodable<'a>> Decodable<'a> for Seq0255<'a, T>

Source§

fn get_structure(data: &[u8]) -> Result<Vec<FieldMarker>, Error>

Defines the expected structure of a type based on binary data. Read more
Source§

fn from_decoded_fields(data: Vec<DecodableField<'a>>) -> Result<Self, Error>

Constructs the type from a vector of decoded fields. Read more
Source§

fn from_bytes(data: &'a mut [u8]) -> Result<Self, Error>

Decodes the type from raw bytes. Read more
Source§

impl Display for Seq0255<'_, U256<'_>>

Source§

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

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

impl<'a> From<Seq0255<'a, Inner<'a, false, 1, 1, 255>>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, B0255<'a>>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Seq0255<'a, Inner<'a, false, 1, 2, { u16::MAX as usize }>>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, B064K<'a>>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Seq0255<'a, Inner<'a, false, 1, 3, { 2_usize.pow(24) - 1 }>>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, B016M<'a>>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Seq0255<'a, Inner<'a, true, 32, 0, 0>>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, U256<'a>>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Seq0255<'a, Inner<'a, true, 64, 0, 0>>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, Signature<'a>>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T: Into<CVec>> From<Seq0255<'a, T>> for CVec2

Source§

fn from(v: Seq0255<'a, T>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Seq0255<'a, U24>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, U24>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Seq0255<'a, bool>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, bool>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Seq0255<'a, u16>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, u16>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Seq0255<'a, u32>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, u32>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Seq0255<'a, u64>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, u64>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Seq0255<'a, u8>> for EncodableField<'a>

Source§

fn from(v: Seq0255<'_, u8>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Vec<T>> for Seq0255<'_, T>

Source§

fn from(v: Vec<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: GetSize> GetSize for Seq0255<'_, T>

Source§

fn get_size(&self) -> usize

get_size returns total size of the type in bytes.
Source§

impl<'a, T: PartialEq> PartialEq for Seq0255<'a, T>

Source§

fn eq(&self, other: &Seq0255<'a, T>) -> 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<'a, T: Eq> Eq for Seq0255<'a, T>

Source§

impl<'a, T> StructuralPartialEq for Seq0255<'a, T>

Auto Trait Implementations§

§

impl<'a, T> Freeze for Seq0255<'a, T>

§

impl<'a, T> RefUnwindSafe for Seq0255<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for Seq0255<'a, T>
where T: Sync + Send,

§

impl<'a, T> Sync for Seq0255<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for Seq0255<'a, T>
where T: Unpin,

§

impl<'a, T> UnwindSafe for Seq0255<'a, 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> 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<'a, T> Encodable for T
where T: Into<EncodableField<'a>>,

Source§

fn to_bytes(self, dst: &mut [u8]) -> Result<usize, Error>

Encodes the object into the provided byte slice. 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.