pub struct UsageCount { /* private fields */ }Expand description
Tracks how often an entity is used in different roles within triples.
Implementations§
Source§impl UsageCount
impl UsageCount
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new UsageCount with all counters initialized to zero.
Sourcepub fn as_predicate(&self) -> usize
pub fn as_predicate(&self) -> usize
Returns the number of times the entity was used as a predicate.
Sourcepub fn as_subject(&self) -> usize
pub fn as_subject(&self) -> usize
Returns the number of times the entity was used as a subject.
Sourcepub fn increment_as_predicate(&mut self)
pub fn increment_as_predicate(&mut self)
Increments the predicate usage counter.
Sourcepub fn increment_as_subject(&mut self)
pub fn increment_as_subject(&mut self)
Increments the subject usage counter.
Sourcepub fn increment_as_object(&mut self)
pub fn increment_as_object(&mut self)
Increments the object usage counter.
Sourcepub fn increment_as_predicate_in_triple(&mut self)
pub fn increment_as_predicate_in_triple(&mut self)
Increments the predicate-in-triple counter.
Sourcepub fn increment_as_subject_in_triple(&mut self)
pub fn increment_as_subject_in_triple(&mut self)
Increments the subject-in-triple counter.
Sourcepub fn increment_as_object_in_triple(&mut self)
pub fn increment_as_object_in_triple(&mut self)
Increments the object-in-triple counter.
Trait Implementations§
Source§impl Default for UsageCount
impl Default for UsageCount
Auto Trait Implementations§
impl Freeze for UsageCount
impl RefUnwindSafe for UsageCount
impl Send for UsageCount
impl Sync for UsageCount
impl Unpin for UsageCount
impl UnsafeUnpin for UsageCount
impl UnwindSafe for UsageCount
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
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.