Struct linkspace::prelude::B64

#[repr(transparent)]
pub struct B64<N = [u8; 32]>(pub N);
Expand description

newtype around bytes to print/parse b64 (url-safe no-padding)

Tuple Fields§

§0: N

Implementations§

§

impl<N> B64<N>

pub fn into_bytes(self) -> [u8; { _ }]

pub fn inner(self) -> N

pub fn from_ref(b: &N) -> &B64<N>

§

impl<N> B64<N>where B64<N>: AsRef<[u8]>,

pub fn b64(&self) -> String

pub fn b64_mini(&self) -> String

pub fn b64_into(&self, output_buf: &mut String)

§

impl B64<Vec<u8>>

pub fn parse_str(v: impl AsRef<[u8]>) -> Result<B64<Vec<u8>>, DecodeError>

§

impl<const N: usize> B64<[u8; N]>

pub fn try_fit_bytes_or_b64(slice: &[u8]) -> Result<B64<[u8; N]>, DecodeError>

pub fn try_fit_slice(slice: &[u8]) -> Result<B64<[u8; N]>, FitSliceErr>

pub fn parse_str(st: impl AsRef<[u8]>) -> Result<B64<[u8; N]>, DecodeError>

§

impl B64

pub fn to_u256(self) -> Uint<256, 4>

pub fn from_u256(value: Uint<256, 4>) -> B64

Trait Implementations§

§

impl<const L: usize> ABEValidator for B64<[u8; L]>

§

fn check(b: &[ABE]) -> Result<(), MatchError>

§

impl<N> AsRef<[u8]> for B64<N>where N: AsRef<[u8]>,

§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl AsRef<[u8; 32]> for B64<[u128; 2]>

§

fn as_ref(&self) -> &[u8; 32]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<N> AsRef<N> for B64<N>

§

fn as_ref(&self) -> &N

Converts this type into a shared reference of the (usually inferred) input type.
§

impl BitXor for B64

§

type Output = B64

The resulting type after applying the ^ operator.
§

fn bitxor(self, rhs: B64) -> <B64 as BitXor>::Output

Performs the ^ operation. Read more
§

impl<N> Borrow<N> for B64<N>

§

fn borrow(&self) -> &N

Immutably borrows from an owned value. Read more
§

impl<N> Clone for B64<N>where N: Clone,

§

fn clone(&self) -> B64<N>

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
§

impl<N> Debug for B64<N>where B64<N>: AsRef<[u8]>,

§

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

Formats the value using the given formatter. Read more
§

impl<N> Default for B64<N>where N: Default,

§

fn default() -> B64<N>

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

impl<N> Deref for B64<N>

§

type Target = N

The resulting type after dereferencing.
§

fn deref(&self) -> &<B64<N> as Deref>::Target

Dereferences the value.
§

impl<N> DerefMut for B64<N>

§

fn deref_mut(&mut self) -> &mut <B64<N> as Deref>::Target

Mutably dereferences the value.
§

impl<'de, N> Deserialize<'de> for B64<N>where N: Deserialize<'de>,

§

fn deserialize<__D>( __deserializer: __D ) -> Result<B64<N>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<N> Display for B64<N>where B64<N>: AsRef<[u8]>,

§

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

Formats the value using the given formatter. Read more
§

impl From<B64> for NetPktHeader

§

fn from(v: B64) -> NetPktHeader

Converts to this type from the input type.
§

impl<N> From<N> for B64<N>

§

fn from(v: N) -> B64<N>

Converts to this type from the input type.
§

impl From<NetPktHeader> for B64

§

fn from(val: NetPktHeader) -> B64

Converts to this type from the input type.
§

impl From<Uint<256, 4>> for B64

§

fn from(val: Uint<256, 4>) -> B64

Converts to this type from the input type.
§

impl From<Uint<512, 8>> for B64<[u8; 64]>

§

fn from(val: Uint<512, 8>) -> B64<[u8; 64]>

Converts to this type from the input type.
§

impl<const N: usize> FromStr for B64<[u8; N]>

§

type Err = DecodeError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<B64<[u8; N]>, <B64<[u8; N]> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl<N> Hash for B64<N>where N: Hash,

§

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<N> Ord for B64<N>where N: Ord,

§

fn cmp(&self, other: &B64<N>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl<N> PartialEq for B64<N>where N: PartialEq,

§

fn eq(&self, other: &B64<N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl<N> PartialOrd for B64<N>where N: PartialOrd,

§

fn partial_cmp(&self, other: &B64<N>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl<N> Serialize for B64<N>where N: Serialize,

§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl<N> ToABE for B64<N>where B64<N>: AsRef<[u8]>,

§

fn write_abe(&self, out: &mut dyn FnMut(ABE))

§

fn to_abe_str(&self) -> String

§

fn to_abe(&self) -> Vec<ABE>

§

impl<const L: usize> TryFrom<&[u8]> for B64<[u8; L]>

§

type Error = FitSliceErr

The type returned in the event of a conversion error.
§

fn try_from( value: &[u8] ) -> Result<B64<[u8; L]>, <B64<[u8; L]> as TryFrom<&[u8]>>::Error>

Performs the conversion.
§

impl<const L: usize> TryFrom<ABList> for B64<[u8; L]>

§

type Error = DecodeError

The type returned in the event of a conversion error.
§

fn try_from( value: ABList ) -> Result<B64<[u8; L]>, <B64<[u8; L]> as TryFrom<ABList>>::Error>

Performs the conversion.
§

impl UInt for B64

§

const MIN: B64 = _

§

const MAX: B64 = _

§

const ONE: B64 = _

§

const BITS: u32 = 256u32

§

fn bit_and(self, other: B64) -> B64

§

fn bit_or(self, other: B64) -> B64

§

fn not(self) -> B64

§

fn inc(self) -> Option<B64>

§

fn decr(self) -> Option<B64>

§

fn checked_sub(self, other: B64) -> Option<B64>

§

fn checked_add(self, other: B64) -> Option<B64>

§

fn overflowing_shl(self, rhs: u32) -> (B64, bool)

§

fn overflowing_shr(self, rhs: u32) -> (B64, bool)

§

fn leading_zeros(&self) -> u32

§

fn trailing_zeros(&self) -> u32

§

fn trailing_ones(&self) -> u32

§

fn leading_ones(&self) -> u32

§

fn overflowing_add(self, rhs: B64) -> (B64, bool)

§

fn as_be_bytes(&self, out: &mut dyn FnMut(&[u8]))

§

fn to_be_vec(&self) -> Vec<u8>

§

impl<N> Zeroable for B64<N>where N: Zeroable,

§

fn zeroed() -> Self

§

impl<N> Copy for B64<N>where N: Copy,

§

impl<N> Eq for B64<N>where N: Eq,

§

impl<N> Pod for B64<N>where N: Pod,

§

impl<N> StructuralEq for B64<N>

§

impl<N> StructuralPartialEq for B64<N>

Auto Trait Implementations§

§

impl<N> RefUnwindSafe for B64<N>where N: RefUnwindSafe,

§

impl<N> Send for B64<N>where N: Send,

§

impl<N> Sync for B64<N>where N: Sync,

§

impl<N> Unpin for B64<N>where N: Unpin,

§

impl<N> UnwindSafe for B64<N>where N: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> IntoResult<T> for T

§

type Err = Infallible

§

fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> AnyBitPattern for Twhere T: Pod,

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

§

impl<T> Formattable for Twhere T: Deref, <T as Deref>::Target: Formattable,

§

impl<T> NoUninit for Twhere T: Pod,

§

impl<T> Parsable for Twhere T: Deref, <T as Deref>::Target: Parsable,