pub struct HopperAuthoringString<'a, const N: usize> { /* private fields */ }Expand description
Lifetime-shaped bounded UTF-8 authoring value.
Hopper account macros accept String<'a, N> as the canonical pretty
dynamic-field syntax and lower it into the compact tail model. This wrapper
makes the same spelling available to type checkers without changing the
owned runtime representation, which remains HopperString<N>.
Implementations§
Source§impl<'a, const N: usize> HopperAuthoringString<'a, N>
impl<'a, const N: usize> HopperAuthoringString<'a, N>
pub const fn empty() -> Self
pub fn from_str(value: &str) -> Result<Self>
pub const fn from_hopper(inner: HopperString<N>) -> Self
pub const fn as_hopper(&self) -> &HopperString<N>
pub fn into_hopper(self) -> HopperString<N>
pub fn set_str(&mut self, value: &str) -> Result<()>
pub fn as_str(&self) -> Result<&str>
pub fn as_bytes(&self) -> &[u8]
Trait Implementations§
Source§impl<'a, const N: usize> Clone for HopperAuthoringString<'a, N>
impl<'a, const N: usize> Clone for HopperAuthoringString<'a, N>
Source§fn clone(&self) -> HopperAuthoringString<'a, N>
fn clone(&self) -> HopperAuthoringString<'a, N>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a, const N: usize> Default for HopperAuthoringString<'a, N>
impl<'a, const N: usize> Default for HopperAuthoringString<'a, N>
Source§impl<'a, const N: usize> PartialEq for HopperAuthoringString<'a, N>
impl<'a, const N: usize> PartialEq for HopperAuthoringString<'a, N>
Source§fn eq(&self, other: &HopperAuthoringString<'a, N>) -> bool
fn eq(&self, other: &HopperAuthoringString<'a, N>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'a, const N: usize> TailCodec for HopperAuthoringString<'a, N>
impl<'a, const N: usize> TailCodec for HopperAuthoringString<'a, N>
Source§const MAX_ENCODED_LEN: usize = HopperString<N>::MAX_ENCODED_LEN
const MAX_ENCODED_LEN: usize = HopperString<N>::MAX_ENCODED_LEN
Upper bound on the encoded size. Used by generated helpers to
verify the account has enough room before invoking
encode.
Implementors should pick the smallest valid bound. Hopper
uses this to pre-size reallocs.impl<'a, const N: usize> Copy for HopperAuthoringString<'a, N>
impl<'a, const N: usize> Eq for HopperAuthoringString<'a, N>
impl<'a, const N: usize> StructuralPartialEq for HopperAuthoringString<'a, N>
Auto Trait Implementations§
impl<'a, const N: usize> Freeze for HopperAuthoringString<'a, N>
impl<'a, const N: usize> RefUnwindSafe for HopperAuthoringString<'a, N>
impl<'a, const N: usize> Send for HopperAuthoringString<'a, N>
impl<'a, const N: usize> Sync for HopperAuthoringString<'a, N>
impl<'a, const N: usize> Unpin for HopperAuthoringString<'a, N>
impl<'a, const N: usize> UnsafeUnpin for HopperAuthoringString<'a, N>
impl<'a, const N: usize> UnwindSafe for HopperAuthoringString<'a, N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more