Struct Bytes

Source
pub struct Bytes<const BIG_ENDIAN: bool = true> {
    pub vec: Vector<u8>,
}

Fields§

§vec: Vector<u8>

Implementations§

Source§

impl<const BE: bool> Bytes<BE>

Source

pub fn as_slice(&self) -> &[u8]

Source

pub fn to_int128(&self) -> Result<i128, String>

Source

pub fn to_bin(&self) -> Bins

Source

pub fn to_hex(&self) -> Hex

Source

pub fn from_bytes(from: &[u8]) -> Self

Source

pub fn from_int(from: &i128) -> Self

Source

pub fn from_bins(from: &Bins) -> Self

Source

pub fn from_hex(from: &Hex) -> Self

Trait Implementations§

Source§

impl<const BIG_ENDIAN: bool> Debug for Bytes<BIG_ENDIAN>

Source§

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

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

impl DebugBytes for Bytes<true>

Source§

fn print(&self)

Source§

impl Default for Bytes

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<Vec<u8>> for Bytes

Source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<Vector<u8>> for Bytes

Source§

fn from(value: Vector<u8>) -> Self

Converts to this type from the input type.
Source§

impl Into<Vec<u8>> for Bytes

Source§

fn into(self) -> Vec<u8>

Converts this type into the (usually inferred) input type.
Source§

impl Into<Vector<u8>> for Bytes

Source§

fn into(self) -> Vector<u8>

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

§

impl<const BIG_ENDIAN: bool> Freeze for Bytes<BIG_ENDIAN>

§

impl<const BIG_ENDIAN: bool> RefUnwindSafe for Bytes<BIG_ENDIAN>

§

impl<const BIG_ENDIAN: bool = true> !Send for Bytes<BIG_ENDIAN>

§

impl<const BIG_ENDIAN: bool = true> !Sync for Bytes<BIG_ENDIAN>

§

impl<const BIG_ENDIAN: bool> Unpin for Bytes<BIG_ENDIAN>

§

impl<const BIG_ENDIAN: bool> UnwindSafe for Bytes<BIG_ENDIAN>

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> 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, 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.