pub struct TrustEngine { /* private fields */ }Expand description
Trust scoring engine
Implementations§
Source§impl TrustEngine
impl TrustEngine
pub fn new(repo_root: &Path) -> Self
Sourcepub fn get_score(&self, did: &str) -> Result<TrustScore, LitError>
pub fn get_score(&self, did: &str) -> Result<TrustScore, LitError>
Get or initialize a trust score for an agent
Sourcepub fn record_event(
&self,
did: &str,
event: TrustEvent,
) -> Result<TrustScore, LitError>
pub fn record_event( &self, did: &str, event: TrustEvent, ) -> Result<TrustScore, LitError>
Record a trust event for an agent
Sourcepub fn list_agents(&self) -> Result<Vec<TrustScore>, LitError>
pub fn list_agents(&self) -> Result<Vec<TrustScore>, LitError>
List all known agents with trust scores
Auto Trait Implementations§
impl Freeze for TrustEngine
impl RefUnwindSafe for TrustEngine
impl Send for TrustEngine
impl Sync for TrustEngine
impl Unpin for TrustEngine
impl UnsafeUnpin for TrustEngine
impl UnwindSafe for TrustEngine
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