pub struct CommandMetadata {
pub description: String,
pub timestamp: Instant,
pub source: CommandSource,
pub batch_id: Option<u64>,
}Expand description
Metadata attached to every command for tracing and UI display.
Fields§
§description: StringHuman-readable description for UI (e.g., “Insert text”).
timestamp: InstantWhen the command was created.
source: CommandSourceWho/what triggered the command.
batch_id: Option<u64>Optional batch ID for grouping related commands.
Implementations§
Source§impl CommandMetadata
impl CommandMetadata
Sourcepub fn new(description: impl Into<String>) -> Self
pub fn new(description: impl Into<String>) -> Self
Create new metadata with the given description.
Sourcepub fn with_source(self, source: CommandSource) -> Self
pub fn with_source(self, source: CommandSource) -> Self
Set the command source.
Sourcepub fn with_batch(self, batch_id: u64) -> Self
pub fn with_batch(self, batch_id: u64) -> Self
Set the batch ID for grouping.
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Size in bytes for memory accounting.
Trait Implementations§
Source§impl Clone for CommandMetadata
impl Clone for CommandMetadata
Source§fn clone(&self) -> CommandMetadata
fn clone(&self) -> CommandMetadata
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 CommandMetadata
impl Debug for CommandMetadata
Auto Trait Implementations§
impl Freeze for CommandMetadata
impl RefUnwindSafe for CommandMetadata
impl Send for CommandMetadata
impl Sync for CommandMetadata
impl Unpin for CommandMetadata
impl UnsafeUnpin for CommandMetadata
impl UnwindSafe for CommandMetadata
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