pub struct DidMessageBody {
pub action: String,
pub resource: String,
pub privacy: String,
pub reply_to: Option<DidMessageReference>,
}Expand description
Message metadata that policy engines evaluate before payload use.
Fields§
§action: StringRequested Typesec action, such as ai:infer.
resource: StringResource identifier for policy evaluation.
privacy: StringPayload privacy label, such as secret.
reply_to: Option<DidMessageReference>Prompt envelope this message is bound to, for reply envelopes.
Implementations§
Source§impl DidMessageBody
impl DidMessageBody
Sourcepub fn infer_prompt(resource: impl Into<String>) -> Self
pub fn infer_prompt(resource: impl Into<String>) -> Self
Create a prompt body for AI inference.
Sourcepub fn reply_to_prompt(prompt: &VerifiedDidPrompt) -> Self
pub fn reply_to_prompt(prompt: &VerifiedDidPrompt) -> Self
Create a reply body that inherits the prompt’s policy-visible metadata.
Trait Implementations§
Source§impl Clone for DidMessageBody
impl Clone for DidMessageBody
Source§fn clone(&self) -> DidMessageBody
fn clone(&self) -> DidMessageBody
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DidMessageBody
impl Debug for DidMessageBody
Source§impl<'de> Deserialize<'de> for DidMessageBody
impl<'de> Deserialize<'de> for DidMessageBody
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 DidMessageBody
Source§impl PartialEq for DidMessageBody
impl PartialEq for DidMessageBody
Source§fn eq(&self, other: &DidMessageBody) -> bool
fn eq(&self, other: &DidMessageBody) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DidMessageBody
impl Serialize for DidMessageBody
impl StructuralPartialEq for DidMessageBody
Auto Trait Implementations§
impl Freeze for DidMessageBody
impl RefUnwindSafe for DidMessageBody
impl Send for DidMessageBody
impl Sync for DidMessageBody
impl Unpin for DidMessageBody
impl UnsafeUnpin for DidMessageBody
impl UnwindSafe for DidMessageBody
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