pub struct TasteVerdictRecord {
pub verdict: TasteVerdict,
pub notes: Option<String>,
pub tasted_at_epoch_ms: u64,
}Expand description
A lightweight local taste verdict record for client-side caching.
Unlike the full Taste manifest (which is cryptographically signed and
content-addressed), this struct is for clients to persist their own taste
results locally — e.g. after an LLM safety review or manual inspection.
use substrate::TasteVerdictRecord;
use substrate::TasteVerdict;
let record = TasteVerdictRecord::new(TasteVerdict::Safe, Some("Reviewed, looks good"));
let json = serde_json::to_string_pretty(&record).unwrap();
let parsed: TasteVerdictRecord = serde_json::from_str(&json).unwrap();
assert_eq!(parsed.verdict, TasteVerdict::Safe);Fields§
§verdict: TasteVerdict§notes: Option<String>§tasted_at_epoch_ms: u64Implementations§
Source§impl TasteVerdictRecord
impl TasteVerdictRecord
Sourcepub fn new(verdict: TasteVerdict, notes: Option<&str>) -> Self
pub fn new(verdict: TasteVerdict, notes: Option<&str>) -> Self
Create a new verdict record stamped with the current time.
Sourcepub fn with_timestamp(
verdict: TasteVerdict,
notes: Option<&str>,
epoch_ms: u64,
) -> Self
pub fn with_timestamp( verdict: TasteVerdict, notes: Option<&str>, epoch_ms: u64, ) -> Self
Create a verdict record with an explicit timestamp.
Sourcepub fn allows_use(&self) -> bool
pub fn allows_use(&self) -> bool
Whether this verdict allows the spore to be used (i.e. not toxic).
Sourcepub fn gate_action_for(&self, operation: GateOperation) -> GateAction
pub fn gate_action_for(&self, operation: GateOperation) -> GateAction
Gate action for a given operation based on this verdict.
Trait Implementations§
Source§impl Clone for TasteVerdictRecord
impl Clone for TasteVerdictRecord
Source§fn clone(&self) -> TasteVerdictRecord
fn clone(&self) -> TasteVerdictRecord
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 TasteVerdictRecord
impl Debug for TasteVerdictRecord
Source§impl<'de> Deserialize<'de> for TasteVerdictRecord
impl<'de> Deserialize<'de> for TasteVerdictRecord
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
Source§impl PartialEq for TasteVerdictRecord
impl PartialEq for TasteVerdictRecord
Source§impl Serialize for TasteVerdictRecord
impl Serialize for TasteVerdictRecord
impl StructuralPartialEq for TasteVerdictRecord
Auto Trait Implementations§
impl Freeze for TasteVerdictRecord
impl RefUnwindSafe for TasteVerdictRecord
impl Send for TasteVerdictRecord
impl Sync for TasteVerdictRecord
impl Unpin for TasteVerdictRecord
impl UnsafeUnpin for TasteVerdictRecord
impl UnwindSafe for TasteVerdictRecord
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