pub struct Record {Show 14 fields
pub id: String,
pub schema: u32,
pub kind: Kind,
pub title: String,
pub body: String,
pub trigger: Option<String>,
pub fields: BTreeMap<String, Value>,
pub anchors: Vec<Anchor>,
pub evidence: Vec<String>,
pub snippets: Vec<Snippet>,
pub relation: Option<Relation>,
pub provenance: Provenance,
pub created: String,
pub signature: Option<Signature>,
}Fields§
§id: String§schema: u32§kind: Kind§title: String§body: String§trigger: Option<String>When a future reader needs this (“relevant when adding caching to auth paths”).
fields: BTreeMap<String, Value>Kind-specific fields (alternatives, outcome, rule, severity, …).
anchors: Vec<Anchor>§evidence: Vec<String>commit:<sha>, mr:!412, test:<path>::<name>, url:…, or free text.
snippets: Vec<Snippet>§relation: Option<Relation>§provenance: Provenance§created: StringRFC 3339, UTC.
signature: Option<Signature>Optional SSH signature over the rest of the record .
Implementations§
Source§impl Record
impl Record
pub fn new( kind: Kind, title: &str, anchors: Vec<Anchor>, provenance: Provenance, ) -> Record
Sourcepub fn review(
target: &Record,
action: &str,
reason: &str,
provenance: Provenance,
) -> Result<Record>
pub fn review( target: &Record, action: &str, reason: &str, provenance: Provenance, ) -> Result<Record>
The relation record for a review action (see review_action) on target.
Sourcepub fn vouching(
self,
target: &Record,
now: impl Fn(&str) -> Option<Anchor>,
) -> Record
pub fn vouching( self, target: &Record, now: impl Fn(&str) -> Option<Anchor>, ) -> Record
A confirmation vouches for the code as indexed now: it takes the target’s anchors from now.
Sourcepub fn relation(
kind: RelationKind,
target: &Record,
reason: &str,
provenance: Provenance,
) -> Record
pub fn relation( kind: RelationKind, target: &Record, reason: &str, provenance: Provenance, ) -> Record
A relation record (confirm, retract, …) about target.
Sourcepub fn unsafe_content(&self) -> bool
pub fn unsafe_content(&self) -> bool
A record that slipped past write-time checks (planted straight into the store).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Record
impl<'de> Deserialize<'de> for Record
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 StructuralPartialEq for Record
Auto Trait Implementations§
impl Forget for Record
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnsafeUnpin for Record
impl UnwindSafe for Record
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