pub struct Intent {
pub id: String,
pub capability: Capability,
pub domain: String,
pub params: Value,
pub created_at_ns: u128,
pub ttl_ms: u32,
pub nonce: String,
pub signer: String,
pub signature_b64: String,
pub metadata: HashMap<String, Value>,
}Expand description
Intent sent to executors via JetStream
Fields§
§id: StringUnique intent identifier (UUIDv7 for time ordering)
capability: CapabilityCapability being requested
domain: StringRouting domain/shard
params: ValueCapability-specific parameters
created_at_ns: u128Creation timestamp in nanoseconds
ttl_ms: u32Time-to-live in milliseconds
nonce: StringNonce for deduplication and replay defense
signer: StringPublic key of the signer (base64)
signature_b64: StringDetached signature of canonical intent body (base64)
metadata: HashMap<String, Value>Additional metadata for the intent
Implementations§
Source§impl Intent
impl Intent
Sourcepub fn verify_signature(&self) -> Result<bool>
pub fn verify_signature(&self) -> Result<bool>
Verify the signature of this intent using the embedded signer public key.
Sourcepub fn verify_with_key(&self, verifying_key: &VerifyingKey) -> Result<bool>
pub fn verify_with_key(&self, verifying_key: &VerifyingKey) -> Result<bool>
Verify the signature of this intent with a supplied verifying key.
Source§impl Intent
Intent creation and signing utilities
impl Intent
Intent creation and signing utilities
Sourcepub fn new(
capability: Capability,
domain: String,
params: Value,
ttl_ms: u32,
signer: String,
) -> Self
pub fn new( capability: Capability, domain: String, params: Value, ttl_ms: u32, signer: String, ) -> Self
Create a new intent with the given parameters
Sourcepub fn canonical_json(&self) -> Result<String>
pub fn canonical_json(&self) -> Result<String>
Get canonical JSON representation for signing
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if intent has expired based on current time
Sourcepub fn result_subject(&self) -> String
pub fn result_subject(&self) -> String
Get the result subject for this intent
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Intent
impl<'de> Deserialize<'de> for Intent
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
Auto Trait Implementations§
impl Freeze for Intent
impl RefUnwindSafe for Intent
impl Send for Intent
impl Sync for Intent
impl Unpin for Intent
impl UnsafeUnpin for Intent
impl UnwindSafe for Intent
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