pub struct RingCommand {
pub command_type: String,
pub payload: String,
pub actor: String,
pub role_key: String,
pub request_id: String,
}Expand description
A ring command injected into FU.Data for mediated processing.
The command envelope carries the operation type, a JSON payload,
the requesting actor identity, their role key, and a correlation ID.
All fields serialize to command.* Tree entries via RingCommand::inject_into.
Fields§
§command_type: StringCommand type identifier (e.g. user.create).
payload: StringJSON-serialized command parameters.
actor: StringIdentity of the actor making the request (application-defined label).
CU uses this for authorization decisions. Injected into the Tree
as command.admin by convention; applications may interpret this
field according to their own identity model.
role_key: StringRole key of the requesting actor (application-defined label).
CU evaluates permissions based on this role key. Injected into
the Tree as command.role by convention.
request_id: StringRequest correlation ID for tracing.
Generated by the web layer, carried through all 6 units, returned in the result for response correlation.
Implementations§
Source§impl RingCommand
impl RingCommand
Sourcepub fn new(
command_type: impl Into<String>,
payload: impl Into<String>,
actor: impl Into<String>,
role_key: impl Into<String>,
request_id: impl Into<String>,
) -> Self
pub fn new( command_type: impl Into<String>, payload: impl Into<String>, actor: impl Into<String>, role_key: impl Into<String>, request_id: impl Into<String>, ) -> Self
Create a new ring command.
Sourcepub fn inject_into(&self, tree: &mut Tree)
pub fn inject_into(&self, tree: &mut Tree)
Inject this command into a Tree as command.* entries.
Sourcepub fn extract_from(tree: &Tree) -> Option<Self>
pub fn extract_from(tree: &Tree) -> Option<Self>
Extract a command from a Tree’s command.* entries.
Returns None if command.type is absent (not a command cycle).
Sourcepub fn is_command(tree: &Tree) -> bool
pub fn is_command(tree: &Tree) -> bool
Check if a Tree contains a command (has command.type).
Trait Implementations§
Source§impl Clone for RingCommand
impl Clone for RingCommand
Source§fn clone(&self) -> RingCommand
fn clone(&self) -> RingCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RingCommand
impl Debug for RingCommand
Source§impl<'de> Deserialize<'de> for RingCommand
impl<'de> Deserialize<'de> for RingCommand
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>,
Source§impl PartialEq for RingCommand
impl PartialEq for RingCommand
Source§fn eq(&self, other: &RingCommand) -> bool
fn eq(&self, other: &RingCommand) -> bool
self and other values to be equal, and is used by ==.