Skip to main content

GraphView

Struct GraphView 

Source
pub struct GraphView<'a> {
    pub ids: &'a IdMap,
    pub syms: &'a Interner,
    pub labels: &'a [u32],
    pub props: &'a ColumnStore,
    pub topo: &'a Topology,
    pub edge_props: &'a EdgeProps,
    pub mask: Option<&'a HashSet<u32>>,
}
Expand description

Read-only twin of GraphMut. Holds only borrowed graph state.

Fields§

§ids: &'a IdMap§syms: &'a Interner§labels: &'a [u32]§props: &'a ColumnStore§topo: &'a Topology§edge_props: &'a EdgeProps§mask: Option<&'a HashSet<u32>>

Optional query-scoped node visibility set. None = all nodes visible. When Some(set), only dense ids present in set are accessible.

Implementations§

Source§

impl<'a> GraphView<'a>

Source

pub fn visible(&self, id: u32) -> bool

Returns true if id is visible under the current mask. Always true when no mask is set.

Source

pub fn node_id(&self, key: &str) -> Option<u32>

Source

pub fn key_of(&self, id: u32) -> &str

Source

pub fn label_of(&self, id: u32) -> Option<&str>

Source

pub fn nodes_with_label(&self, label: &str) -> Vec<u32>

Source

pub fn prop(&self, id: u32, field: &str) -> Option<&Value>

Auto Trait Implementations§

§

impl<'a> Freeze for GraphView<'a>

§

impl<'a> RefUnwindSafe for GraphView<'a>

§

impl<'a> Send for GraphView<'a>

§

impl<'a> Sync for GraphView<'a>

§

impl<'a> Unpin for GraphView<'a>

§

impl<'a> UnsafeUnpin for GraphView<'a>

§

impl<'a> UnwindSafe for GraphView<'a>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.