Skip to main content

GraphReference

Enum GraphReference 

Source
pub enum GraphReference<'reference, 'graph> {
    Gbz(&'reference GBZ),
    Db(&'reference mut GraphInterface<'graph>),
    None,
}
Expand description

A reference to a GBZ-compatible graph.

Graph operations with a GBZ graph take an immutable reference to the graph. The corresponding operations with GBZ-base using GraphInterface take a mutable reference instead. This wrapper can be created on demand to encapsulate a reference to either type of graph.

Variants§

§

Gbz(&'reference GBZ)

A GBZ graph.

§

Db(&'reference mut GraphInterface<'graph>)

§

None

No graph provided.

Implementations§

Source§

impl<'reference, 'graph> GraphReference<'reference, 'graph>

Source

pub fn gbz_record(&mut self, handle: usize) -> Result<GBZRecord, String>

Returns the record for the oriented node corresponding to the given handle.

§Errors

Returns an error if the handle does not exist in the graph. Returns an error if the graph reference is Self::None. Passes through any errors from the graph implementation.

Source

pub fn graph_name(&mut self) -> Result<GraphName, String>

Returns the stable graph name (pggname) for the graph.

Returns an empty name if the graph reference is Self::None.

§Errors

Returns an empty object if the corresponding GBZ tags cannot be parsed. Passes through any errors from the graph implementation.

Source

pub fn is_none(&self) -> bool

Returns true if the graph reference is Self::None.

Auto Trait Implementations§

§

impl<'reference, 'graph> Freeze for GraphReference<'reference, 'graph>

§

impl<'reference, 'graph> !RefUnwindSafe for GraphReference<'reference, 'graph>

§

impl<'reference, 'graph> !Send for GraphReference<'reference, 'graph>

§

impl<'reference, 'graph> !Sync for GraphReference<'reference, 'graph>

§

impl<'reference, 'graph> Unpin for GraphReference<'reference, 'graph>

§

impl<'reference, 'graph> UnsafeUnpin for GraphReference<'reference, 'graph>

§

impl<'reference, 'graph> !UnwindSafe for GraphReference<'reference, 'graph>

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

Source§

type Output = T

Should always be Self
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.