pub struct OpId(/* private fields */);Expand description
Stable identifier for an operation (human meaningful). Invariant: stable across environments; should not be random.
Implementations§
Source§impl OpId
impl OpId
Sourcepub fn new(value: impl Into<String>) -> Result<Self, IdValidationError>
pub fn new(value: impl Into<String>) -> Result<Self, IdValidationError>
Creates an operation identifier after validating the naming contract.
Accepted values match ^[a-z][a-z0-9_]{0,62}$.
§Examples
use mfm_machine::ids::OpId;
let op_id = OpId::new("keystore_list")?;
assert_eq!(op_id.as_str(), "keystore_list");Trait Implementations§
Source§impl<'de> Deserialize<'de> for OpId
impl<'de> Deserialize<'de> for OpId
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
impl Eq for OpId
impl StructuralPartialEq for OpId
Auto Trait Implementations§
impl Freeze for OpId
impl RefUnwindSafe for OpId
impl Send for OpId
impl Sync for OpId
impl Unpin for OpId
impl UnsafeUnpin for OpId
impl UnwindSafe for OpId
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