#[repr(u16)]pub enum ActionCode {
CreateGenesis = 1,
CommitVersion = 2,
Verify = 3,
Inspect = 4,
}Expand description
Action codes for audit trail entries
As specified in RFC-0002, action codes indicate the type of operation being audited. Codes 1-4 are currently defined, 5-99 are reserved for future standard actions, and 100+ are available for custom extensions.
§Examples
use aion_context::audit::ActionCode;
// Standard actions
let action = ActionCode::CommitVersion;
assert_eq!(action as u16, 2);
// Round-trip through u16
let code = ActionCode::from_u16(3).unwrap();
assert_eq!(code, ActionCode::Verify);Variants§
CreateGenesis = 1
File creation with genesis version
CommitVersion = 2
New version committed to file
Verify = 3
Signature verification performed
Inspect = 4
File inspection/audit operation
Implementations§
Source§impl ActionCode
impl ActionCode
Sourcepub const fn from_u16(value: u16) -> Result<Self>
pub const fn from_u16(value: u16) -> Result<Self>
Convert from raw u16 value
§Errors
Returns an error if the value is not a valid action code.
§Examples
use aion_context::audit::ActionCode;
assert_eq!(ActionCode::from_u16(1).unwrap(), ActionCode::CreateGenesis);
assert_eq!(ActionCode::from_u16(2).unwrap(), ActionCode::CommitVersion);
assert!(ActionCode::from_u16(99).is_err());Sourcepub const fn description(self) -> &'static str
pub const fn description(self) -> &'static str
Get human-readable description
§Examples
use aion_context::audit::ActionCode;
assert_eq!(ActionCode::CreateGenesis.description(), "Create genesis version");
assert_eq!(ActionCode::CommitVersion.description(), "Commit new version");Trait Implementations§
Source§impl Clone for ActionCode
impl Clone for ActionCode
Source§fn clone(&self) -> ActionCode
fn clone(&self) -> ActionCode
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 ActionCode
impl Debug for ActionCode
Source§impl Hash for ActionCode
impl Hash for ActionCode
Source§impl PartialEq for ActionCode
impl PartialEq for ActionCode
impl Copy for ActionCode
impl Eq for ActionCode
impl StructuralPartialEq for ActionCode
Auto Trait Implementations§
impl Freeze for ActionCode
impl RefUnwindSafe for ActionCode
impl Send for ActionCode
impl Sync for ActionCode
impl Unpin for ActionCode
impl UnsafeUnpin for ActionCode
impl UnwindSafe for ActionCode
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more