pub struct TrustRecord {Show 14 fields
pub schema: String,
pub record_id: String,
pub agent: String,
pub action: String,
pub approver: Option<String>,
pub outcome: TrustOutcome,
pub trace_id: String,
pub autonomy_tier: AutonomyTier,
pub timestamp: OffsetDateTime,
pub cost_usd: Option<f64>,
pub chain_index: u64,
pub previous_hash: Option<String>,
pub entry_hash: String,
pub metadata: BTreeMap<String, Value>,
}Fields§
§schema: String§record_id: String§agent: String§action: String§approver: Option<String>§outcome: TrustOutcome§trace_id: String§autonomy_tier: AutonomyTier§timestamp: OffsetDateTime§cost_usd: Option<f64>§chain_index: u64§previous_hash: Option<String>§entry_hash: String§metadata: BTreeMap<String, Value>Implementations§
Source§impl TrustRecord
impl TrustRecord
pub fn new( agent: impl Into<String>, action: impl Into<String>, approver: Option<String>, outcome: TrustOutcome, trace_id: impl Into<String>, autonomy_tier: AutonomyTier, ) -> Self
pub fn release( agent: impl Into<String>, bundle_hash: impl Into<String>, harn_version: impl Into<String>, parent_trust_record_id: Option<String>, trace_id: impl Into<String>, autonomy_tier: AutonomyTier, ) -> Self
Sourcepub fn with_effects_grant(self, effects: Vec<EffectRecord>) -> Self
pub fn with_effects_grant(self, effects: Vec<EffectRecord>) -> Self
Attach the typed effect grant a parent extended to this record. Empty grants are skipped so records stay compact when there is nothing to prove.
pub fn set_effects_grant(&mut self, effects: Vec<EffectRecord>)
pub fn effects_grant(&self) -> Vec<EffectRecord>
Sourcepub fn with_effects_used(self, effects: Vec<EffectRecord>) -> Self
pub fn with_effects_used(self, effects: Vec<EffectRecord>) -> Self
Attach the typed effect set the action actually exercised.
Verifiers must check effects_used ⊆ effects_grant through the
parent chain.
pub fn set_effects_used(&mut self, effects: Vec<EffectRecord>)
pub fn effects_used(&self) -> Vec<EffectRecord>
Sourcepub fn with_parent_record_id(self, parent_record_id: impl Into<String>) -> Self
pub fn with_parent_record_id(self, parent_record_id: impl Into<String>) -> Self
Point this record at its parent’s record_id. The existing
release-record key (parent_trust_record_id) is retained for the
release flow; this is the generic spawn-lineage pointer.
pub fn set_parent_record_id(&mut self, parent_record_id: Option<String>)
pub fn parent_record_id(&self) -> Option<String>
Sourcepub fn with_actor_chain(self, actor_chain: ActorChain) -> Self
pub fn with_actor_chain(self, actor_chain: ActorChain) -> Self
Attach the RFC 8693 actor chain for the principal that caused this record.
Sourcepub fn set_actor_chain(&mut self, actor_chain: Option<ActorChain>)
pub fn set_actor_chain(&mut self, actor_chain: Option<ActorChain>)
Set or clear the reserved actor_chain metadata entry.
Sourcepub fn actor_chain(&self) -> Option<ActorChain>
pub fn actor_chain(&self) -> Option<ActorChain>
Decode the reserved actor-chain metadata entry, dropping malformed values for callers that only need best-effort display data.
Sourcepub fn try_actor_chain(&self) -> Result<Option<ActorChain>, ActorChainError>
pub fn try_actor_chain(&self) -> Result<Option<ActorChain>, ActorChainError>
Decode the reserved actor-chain metadata entry and report malformed RFC 8693 claim shapes to strict validators.
pub fn with_actor_chain_alert(self, alert: Value) -> Self
pub fn set_actor_chain_alert(&mut self, alert: Option<Value>)
pub fn actor_chain_alert(&self) -> Option<&Value>
Trait Implementations§
Source§impl Clone for TrustRecord
impl Clone for TrustRecord
Source§fn clone(&self) -> TrustRecord
fn clone(&self) -> TrustRecord
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 TrustRecord
impl Debug for TrustRecord
Source§impl<'de> Deserialize<'de> for TrustRecord
impl<'de> Deserialize<'de> for TrustRecord
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 TrustRecord
impl PartialEq for TrustRecord
Source§fn eq(&self, other: &TrustRecord) -> bool
fn eq(&self, other: &TrustRecord) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for TrustRecord
impl Serialize for TrustRecord
impl StructuralPartialEq for TrustRecord
Auto Trait Implementations§
impl Freeze for TrustRecord
impl RefUnwindSafe for TrustRecord
impl Send for TrustRecord
impl Sync for TrustRecord
impl Unpin for TrustRecord
impl UnsafeUnpin for TrustRecord
impl UnwindSafe for TrustRecord
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);