Skip to main content

EdgeCtx

Struct EdgeCtx 

Source
pub struct EdgeCtx<'a, S> { /* private fields */ }
Expand description

Per-edge context passed to a Kernel.

Holds the current edge (src)-[edge]->(dest) and the relevant per-path state. Typed getters read node/edge Arrow payload columns by internal row id.

Implementations§

Source§

impl<'a, S> EdgeCtx<'a, S>

Source

pub fn with_state<'b>(&'b self, state: &'b S) -> EdgeCtx<'b, S>

Returns a context borrowing state in place of the current one.

Mirrors the DSL’s with_state; used to evaluate stop against the child state produced by next_state.

Source

pub fn graph(&self) -> &'a Graph

The graph being traversed.

Source

pub fn src(&self) -> NodeId

Internal id of the edge’s source node.

Source

pub fn dest(&self) -> NodeId

Internal id of the edge’s destination node.

Source

pub fn edge(&self) -> EdgeId

Internal id of the current edge.

Source

pub fn state(&self) -> &S

The per-path state.

Source

pub fn src_id(&self) -> Option<GraphId<'a>>

External id of the source node, if present.

Source

pub fn dest_id(&self) -> Option<GraphId<'a>>

External id of the destination node, if present.

Source

pub fn edge_id(&self) -> Option<GraphId<'a>>

External id of the current edge, if present.

Source

pub fn src_value(&self, col: &str) -> Result<Value>

Reads node payload column col for the source node.

Source

pub fn dest_value(&self, col: &str) -> Result<Value>

Reads node payload column col for the destination node.

Source

pub fn edge_value(&self, col: &str) -> Result<Value>

Reads edge payload column col for the current edge.

Source

pub fn src_u64(&self, col: &str) -> Result<Option<u64>>

Source node payload col as u64.

Coerces from integer/float when lossless; Ok(None) if null. Errors on negative or non-integral values.

Source

pub fn dest_u64(&self, col: &str) -> Result<Option<u64>>

Destination node payload col as u64.

Coerces from integer/float when lossless; Ok(None) if null. Errors on negative or non-integral values.

Source

pub fn edge_u64(&self, col: &str) -> Result<Option<u64>>

Edge payload col as u64.

Coerces from integer/float when lossless; Ok(None) if null. Errors on negative or non-integral values.

Source

pub fn src_i64(&self, col: &str) -> Result<Option<i64>>

Source node payload col as i64.

Coerces from integer/float when lossless; Ok(None) if null. Errors on out-of-range or non-integral values.

Source

pub fn dest_i64(&self, col: &str) -> Result<Option<i64>>

Destination node payload col as i64.

Coerces from integer/float when lossless; Ok(None) if null. Errors on out-of-range or non-integral values.

Source

pub fn edge_i64(&self, col: &str) -> Result<Option<i64>>

Edge payload col as i64.

Coerces from integer/float when lossless; Ok(None) if null. Errors on out-of-range or non-integral values.

Source

pub fn src_f64(&self, col: &str) -> Result<Option<f64>>

Source node payload col as f64.

Coerces from any numeric type; Ok(None) if null.

Source

pub fn dest_f64(&self, col: &str) -> Result<Option<f64>>

Destination node payload col as f64.

Coerces from any numeric type; Ok(None) if null.

Source

pub fn edge_f64(&self, col: &str) -> Result<Option<f64>>

Edge payload col as f64.

Coerces from any numeric type; Ok(None) if null.

Source

pub fn src_bool(&self, col: &str) -> Result<Option<bool>>

Source node payload col as bool. Ok(None) if null.

Source

pub fn dest_bool(&self, col: &str) -> Result<Option<bool>>

Destination node payload col as bool. Ok(None) if null.

Source

pub fn edge_bool(&self, col: &str) -> Result<Option<bool>>

Edge payload col as bool. Ok(None) if null.

Source

pub fn src_str(&self, col: &str) -> Result<Option<String>>

Source node payload col as String. Ok(None) if null.

Source

pub fn dest_str(&self, col: &str) -> Result<Option<String>>

Destination node payload col as String. Ok(None) if null.

Source

pub fn edge_str(&self, col: &str) -> Result<Option<String>>

Edge payload col as String. Ok(None) if null.

Auto Trait Implementations§

§

impl<'a, S> !RefUnwindSafe for EdgeCtx<'a, S>

§

impl<'a, S> !Send for EdgeCtx<'a, S>

§

impl<'a, S> !Sync for EdgeCtx<'a, S>

§

impl<'a, S> !UnwindSafe for EdgeCtx<'a, S>

§

impl<'a, S> Freeze for EdgeCtx<'a, S>

§

impl<'a, S> Unpin for EdgeCtx<'a, S>

§

impl<'a, S> UnsafeUnpin for EdgeCtx<'a, S>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.