Skip to main content

RealityGraph

Struct RealityGraph 

Source
pub struct RealityGraph {
    pub repo_id: String,
    pub entities: HashMap<String, Entity>,
    pub out: HashMap<String, Vec<Relationship>>,
    pub inn: HashMap<String, Vec<Relationship>>,
    pub components: Vec<Entity>,
    pub flows: Vec<Flow>,
    pub invariants: Vec<Invariant>,
}
Expand description

In-memory view of the reality graph.

Fields§

§repo_id: String§entities: HashMap<String, Entity>§out: HashMap<String, Vec<Relationship>>

out edges by subject

§inn: HashMap<String, Vec<Relationship>>

in edges by object

§components: Vec<Entity>§flows: Vec<Flow>§invariants: Vec<Invariant>

Implementations§

Source§

impl RealityGraph

Source

pub fn all_rels(&self) -> Vec<&Relationship>

Source§

impl RealityGraph

Source§

impl RealityGraph

Source

pub fn load(store: &Store) -> Result<RealityGraph>

Source

pub fn entity(&self, id: &str) -> Option<&Entity>

Source

pub fn out_edges(&self, id: &str) -> Vec<&Relationship>

Source

pub fn in_edges(&self, id: &str) -> Vec<&Relationship>

Source

pub fn out_pred(&self, id: &str, predicate: &str) -> Vec<&Relationship>

Source

pub fn in_pred(&self, id: &str, predicate: &str) -> Vec<&Relationship>

Source

pub fn entities_of_kind(&self, kind: &str) -> Vec<&Entity>

Entities of a given kind (sorted by name for determinism).

Auto Trait Implementations§

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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, !>

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.