pub struct CanisterRole(pub Cow<'static, str>);Expand description
CanisterRole
A human-readable identifier for a canister role/type (e.g., “root”, “example”).
Stored as Cow<'static, str> so known constants can be zero‑copy while
dynamic values allocate only when needed.
Tuple Fields§
§0: Cow<'static, str>Implementations§
Trait Implementations§
Source§impl AsRef<str> for CanisterRole
impl AsRef<str> for CanisterRole
Source§impl Borrow<str> for CanisterRole
impl Borrow<str> for CanisterRole
Source§impl CandidType for CanisterRole
impl CandidType for CanisterRole
Source§impl Clone for CanisterRole
impl Clone for CanisterRole
Source§fn clone(&self) -> CanisterRole
fn clone(&self) -> CanisterRole
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CanisterRole
impl Debug for CanisterRole
Source§impl<'de> Deserialize<'de> for CanisterRole
impl<'de> Deserialize<'de> for CanisterRole
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CanisterRole
impl Display for CanisterRole
Source§impl From<&String> for CanisterRole
impl From<&String> for CanisterRole
Source§impl From<&'static str> for CanisterRole
impl From<&'static str> for CanisterRole
Source§impl From<CanisterRole> for String
impl From<CanisterRole> for String
Source§fn from(ct: CanisterRole) -> Self
fn from(ct: CanisterRole) -> Self
Converts to this type from the input type.
Source§impl From<String> for CanisterRole
impl From<String> for CanisterRole
Source§impl FromStr for CanisterRole
impl FromStr for CanisterRole
Source§impl Hash for CanisterRole
impl Hash for CanisterRole
Source§impl Ord for CanisterRole
impl Ord for CanisterRole
Source§fn cmp(&self, other: &CanisterRole) -> Ordering
fn cmp(&self, other: &CanisterRole) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CanisterRole
impl PartialEq for CanisterRole
Source§impl PartialOrd for CanisterRole
impl PartialOrd for CanisterRole
Source§impl Serialize for CanisterRole
impl Serialize for CanisterRole
Source§impl Storable for CanisterRole
impl Storable for CanisterRole
Source§fn to_bytes(&self) -> Cow<'_, [u8]>
fn to_bytes(&self) -> Cow<'_, [u8]>
Converts the element into a possibly borrowed byte slice. Read more
Source§fn from_bytes(bytes: Cow<'_, [u8]>) -> Self
fn from_bytes(bytes: Cow<'_, [u8]>) -> Self
Converts bytes into an element.
Source§fn to_bytes_checked(&self) -> Cow<'_, [u8]>
fn to_bytes_checked(&self) -> Cow<'_, [u8]>
Like
to_bytes, but checks that bytes conform to declared bounds.Source§fn into_bytes_checked(self) -> Vec<u8> ⓘwhere
Self: Sized,
fn into_bytes_checked(self) -> Vec<u8> ⓘwhere
Self: Sized,
Like
into_bytes, but checks that bytes conform to declared bounds.Source§fn check_bounds(bytes: &[u8])
fn check_bounds(bytes: &[u8])
Validates that a byte slice fits within this type’s declared bounds.
impl Eq for CanisterRole
impl StructuralPartialEq for CanisterRole
Auto Trait Implementations§
impl Freeze for CanisterRole
impl RefUnwindSafe for CanisterRole
impl Send for CanisterRole
impl Sync for CanisterRole
impl Unpin for CanisterRole
impl UnwindSafe for CanisterRole
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
Source§impl<T> Casing<T> for T
impl<T> Casing<T> for T
Source§fn to_case(&self, case: Case<'_>) -> String
fn to_case(&self, case: Case<'_>) -> String
Convert the string into the given case. It will reference
self and create a new
String with the same pattern and delimeter as case. It will split on boundaries
defined at Boundary::defaults(). Read moreSource§fn set_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
fn set_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
Creates a
StateConverter struct initialized with the boundaries provided. Read moreSource§fn remove_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
fn remove_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
Creates a
StateConverter struct initialized without the boundaries
provided. Read more