pub struct TraverseLimits {
pub result_limit: NonZeroUsize,
pub max_depth: Option<NonZeroU32>,
}Expand description
Limits for a single traverse query (result cap and optional hop bound).
§Semantics
result_limit: maximum nodes returned or counted; each seed counts toward the cap.max_depth: whenSome(d), discovers all nodes withindhops of a seed (boundary nodes are counted but not enqueued past the depth cap). WhenNone, expansion is unbounded by depth (still capped byresult_limit).
Fields§
§result_limit: NonZeroUsizeMaximum nodes returned (each seed counts toward the cap).
max_depth: Option<NonZeroU32>None = unlimited hops; Some(d) discovers nodes within d hops of a seed.
Implementations§
Source§impl TraverseLimits
impl TraverseLimits
Sourcepub const fn bounded(result_limit: NonZeroUsize) -> Self
pub const fn bounded(result_limit: NonZeroUsize) -> Self
Sourcepub fn capped_by(self, config: &Config) -> Result<Self, PostgresGraphError>
pub fn capped_by(self, config: &Config) -> Result<Self, PostgresGraphError>
Applies configured traverse cap from config.
§Errors
Returns PostgresGraphError::Query when the capped limit is zero.
§Performance
This method is O(1).
Trait Implementations§
Source§impl Clone for TraverseLimits
impl Clone for TraverseLimits
Source§fn clone(&self) -> TraverseLimits
fn clone(&self) -> TraverseLimits
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 moreSource§impl Debug for TraverseLimits
impl Debug for TraverseLimits
Source§impl PartialEq for TraverseLimits
impl PartialEq for TraverseLimits
Source§fn eq(&self, other: &TraverseLimits) -> bool
fn eq(&self, other: &TraverseLimits) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for TraverseLimits
impl Eq for TraverseLimits
impl StructuralPartialEq for TraverseLimits
Auto Trait Implementations§
impl Freeze for TraverseLimits
impl RefUnwindSafe for TraverseLimits
impl Send for TraverseLimits
impl Sync for TraverseLimits
impl Unpin for TraverseLimits
impl UnsafeUnpin for TraverseLimits
impl UnwindSafe for TraverseLimits
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