Struct EdgeSearch

Source
#[non_exhaustive]
pub struct EdgeSearch<'search, Graph>
where Graph: Graph,
{ pub label: Option<<Graph::Edge as Element>::Label>, pub adjacent_label: Option<<Graph::Vertex as Element>::Label>, pub direction: Direction, pub limit: Option<usize>, /* private fields */ }
Expand description

A search to apply to edges when querying a graph. This allows graph implementations to support vertex centric indexes. In the future, this will be expanded to support more complex filters than just label and direction.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§label: Option<<Graph::Edge as Element>::Label>

the label of the edges

§adjacent_label: Option<<Graph::Vertex as Element>::Label>

The required adjacent label

§direction: Direction

The direction of the edge to match.

§limit: Option<usize>

The maximum number of edges to return for the current vertex

Implementations§

Source§

impl<Graph> EdgeSearch<'_, Graph>
where Graph: Graph,

Source

pub fn scan() -> Self

Creates a new edge search with default settings.

This creates an edge search that will match all edges, regardless of label, adjacent label, or direction.

§Returns

A new EdgeSearch with default settings.

Source

pub fn label(label: <Graph::Edge as Element>::Label) -> Self

Edges must match the label

Source

pub fn outgoing(self) -> Self

Outgoing edges

Source

pub fn incoming(self) -> Self

Outgoing edges

Source

pub fn direction(self, direction: Direction) -> Self

The direction of the edges relative to the starting vertex

Source

pub fn take(self, n: usize) -> Self

The maximum number of edges to return relative to the starting vertex.

The name take follows Rust’s standard library’s naming conventions.

Source

pub fn with_limit(self, limit: usize) -> Self

The maximum number of edges to return relative to the starting vertex.

Source

pub fn limit(&self) -> usize

Returns the maximum number of edges to return from this search.

If no limit was set, returns usize::MAX (effectively no limit).

§Returns

The edge limit, or usize::MAX if no limit was set

Source

pub fn adjacent_labelled( self, adjacent_label: <Graph::Vertex as Element>::Label, ) -> Self

Adjacent vertex label must match

Trait Implementations§

Source§

impl<Graph> Clone for EdgeSearch<'_, Graph>
where Graph: Graph,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Graph> Default for EdgeSearch<'_, Graph>
where Graph: Graph,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'search, Graph> Freeze for EdgeSearch<'search, Graph>
where <<Graph as Graph>::Edge as Element>::Label: Freeze, <<Graph as Graph>::Vertex as Element>::Label: Freeze,

§

impl<'search, Graph> RefUnwindSafe for EdgeSearch<'search, Graph>
where <<Graph as Graph>::Edge as Element>::Label: RefUnwindSafe, <<Graph as Graph>::Vertex as Element>::Label: RefUnwindSafe,

§

impl<'search, Graph> Send for EdgeSearch<'search, Graph>
where <<Graph as Graph>::Edge as Element>::Label: Send, <<Graph as Graph>::Vertex as Element>::Label: Send,

§

impl<'search, Graph> Sync for EdgeSearch<'search, Graph>
where <<Graph as Graph>::Edge as Element>::Label: Sync, <<Graph as Graph>::Vertex as Element>::Label: Sync,

§

impl<'search, Graph> Unpin for EdgeSearch<'search, Graph>
where <<Graph as Graph>::Edge as Element>::Label: Unpin, <<Graph as Graph>::Vertex as Element>::Label: Unpin,

§

impl<'search, Graph> UnwindSafe for EdgeSearch<'search, Graph>
where <<Graph as Graph>::Edge as Element>::Label: UnwindSafe, <<Graph as Graph>::Vertex as Element>::Label: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.