pub struct Context<'l, D, S, T, ST, V>
where D: Datable, S: Spatial<V>, T: Temporable<V>, ST: SpaceTemporal<V>, V: Default + Copy + Clone + Hash + Eq + PartialEq + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, Output = V>,
{ /* private fields */ }

Implementations§

source§

impl<'l, D, S, T, ST, V> Context<'l, D, S, T, ST, V>
where D: Datable, S: Spatial<V>, T: Temporable<V>, ST: SpaceTemporal<V>, V: Default + Copy + Clone + Hash + Eq + PartialEq + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, Output = V>,

source

pub fn with_capacity(id: u64, name: &'l str, capacity: usize) -> Self

Creates a new context with the given node capacity.

source

pub fn name(&self) -> &str

Returns the name of the context.

Trait Implementations§

source§

impl<'l, D, S, T, ST, V> ContextuableGraph<'l, D, S, T, ST, V> for Context<'l, D, S, T, ST, V>
where D: Datable, S: Spatial<V>, T: Temporable<V>, ST: SpaceTemporal<V>, V: Default + Copy + Clone + Hash + Eq + PartialEq + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, Output = V>,

source§

fn add_node(&mut self, value: Contextoid<D, S, T, ST, V>) -> usize

Ads a new Contextoid to the context. You can add the same contextoid multiple times, but each one will return a new and unique node index.

source§

fn contains_node(&self, index: usize) -> bool

Returns only true if the context contains the contextoid with the given index.

source§

fn get_node(&self, index: usize) -> Option<&Contextoid<D, S, T, ST, V>>

Returns a reference to the contextoid with the given index. If the context does not contain the contextoid, it will return None.

source§

fn remove_node(&mut self, index: usize) -> Result<(), ContextIndexError>

Removes a contextoid from the context. Returns ContextIndexError if the index is not found

source§

fn add_edge( &mut self, a: usize, b: usize, weight: RelationKind ) -> Result<(), ContextIndexError>

Adds a new weighted edge between two nodes. Returns either Ok after success, or ContextIndexError if any of the nodes are not in the context.

source§

fn contains_edge(&self, a: usize, b: usize) -> bool

Returns only true if the context contains the edge between the two nodes. If the context does not contain the edge or any of the nodes it will return false. You may want to call contains_node first to ascertain that the nodes are in the context.

source§

fn remove_edge(&mut self, a: usize, b: usize) -> Result<(), ContextIndexError>

Removes an edge between two nodes. Returns either Ok after success, or ContextIndexError if any of the nodes are not in the context.

source§

fn size(&self) -> usize

Returns the number of nodes in the context. Alias for node_count().

source§

fn is_empty(&self) -> bool

Returns true if the context contains no nodes.

source§

fn node_count(&self) -> usize

Returns the number of nodes in the context.

source§

fn edge_count(&self) -> usize

Returns the number of edges in the context.

source§

impl<'l, D, S, T, ST, V> Debug for Context<'l, D, S, T, ST, V>
where D: Datable, S: Spatial<V>, T: Temporable<V>, ST: SpaceTemporal<V>, V: Default + Copy + Clone + Hash + Eq + PartialEq + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, Output = V>,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'l, D, S, T, ST, V> Display for Context<'l, D, S, T, ST, V>
where D: Datable, S: Spatial<V>, T: Temporable<V>, ST: SpaceTemporal<V>, V: Default + Copy + Clone + Hash + Eq + PartialEq + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, Output = V>,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'l, D, S, T, ST, V> ExtendableContextuableGraph<'l, D, S, T, ST, V> for Context<'l, D, S, T, ST, V>
where D: Datable, S: Spatial<V>, T: Temporable<V>, ST: SpaceTemporal<V>, V: Default + Copy + Clone + Hash + Eq + PartialEq + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, Output = V>,

source§

impl<'l, D, S, T, ST, V> Identifiable for Context<'l, D, S, T, ST, V>
where D: Datable, S: Spatial<V>, T: Temporable<V>, ST: SpaceTemporal<V>, V: Default + Copy + Clone + Hash + Eq + PartialEq + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, Output = V>,

source§

fn id(&self) -> u64

Returns the id of the context.

source§

impl<'l, D, S, T, ST, V> Indexable for Context<'l, D, S, T, ST, V>
where D: Datable, S: Spatial<V>, T: Temporable<V>, ST: SpaceTemporal<V>, V: Default + Copy + Clone + Hash + Eq + PartialEq + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, Output = V>,

source§

fn get_index(&self, key: &usize, current: bool) -> Option<&usize>

Gets the index for the provided key from either the current or previous index map, depending on the value of current. Read more
source§

fn set_index(&mut self, key: usize, index: usize, current: bool)

Sets the index for the provided key in either the current or previous index map, depending on the value of current. Read more

Auto Trait Implementations§

§

impl<'l, D, S, T, ST, V> RefUnwindSafe for Context<'l, D, S, T, ST, V>

§

impl<'l, D, S, T, ST, V> Send for Context<'l, D, S, T, ST, V>
where D: Send, S: Send, ST: Send, T: Send, V: Send,

§

impl<'l, D, S, T, ST, V> Sync for Context<'l, D, S, T, ST, V>
where D: Sync, S: Sync, ST: Sync, T: Sync, V: Sync,

§

impl<'l, D, S, T, ST, V> Unpin for Context<'l, D, S, T, ST, V>
where D: Unpin, S: Unpin, ST: Unpin, T: Unpin, V: Unpin,

§

impl<'l, D, S, T, ST, V> UnwindSafe for Context<'l, D, S, T, ST, V>

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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

§

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.