pub struct GraphDecay { /* private fields */ }Expand description
Recency-decay parameters for graph traversal (ADD task graph-decay-recency,
contract v1). Maps to Moon’s GRAPH.QUERY ... --decay <λ> [--time-weight <w>]
read-path clause: effective edge cost = |weight| + λ·w·age_seconds.
Fields are PRIVATE — validity by construction. new rejects non-finite or
negative λ; with_time_weight rejects non-finite or non-positive w, so a
time weight without a decay rate is unrepresentable.
Implementations§
Source§impl GraphDecay
impl GraphDecay
Sourcepub fn new(lambda: f64) -> Result<GraphDecay, StorageError>
pub fn new(lambda: f64) -> Result<GraphDecay, StorageError>
Construct with a decay rate λ. Accepts finite λ ≥ 0 only (λ = 0 is valid and decay-neutral, matching Moon’s server-side validation).
Sourcepub fn with_time_weight(self, w: f64) -> Result<GraphDecay, StorageError>
pub fn with_time_weight(self, w: f64) -> Result<GraphDecay, StorageError>
Set the time-weight multiplier w. Accepts finite w > 0 only.
Sourcepub fn time_weight(&self) -> Option<f64>
pub fn time_weight(&self) -> Option<f64>
The time-weight multiplier, if set (finite, > 0).
Trait Implementations§
Source§impl Clone for GraphDecay
impl Clone for GraphDecay
Source§fn clone(&self) -> GraphDecay
fn clone(&self) -> GraphDecay
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GraphDecay
Source§impl Debug for GraphDecay
impl Debug for GraphDecay
Source§impl PartialEq for GraphDecay
impl PartialEq for GraphDecay
impl StructuralPartialEq for GraphDecay
Auto Trait Implementations§
impl Freeze for GraphDecay
impl RefUnwindSafe for GraphDecay
impl Send for GraphDecay
impl Sync for GraphDecay
impl Unpin for GraphDecay
impl UnsafeUnpin for GraphDecay
impl UnwindSafe for GraphDecay
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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 more