pub struct Context<D, S, T, ST, SYM, VS, VT>where
D: Datable + Clone,
S: Spatial<VS> + Clone,
T: Temporal<VT> + Clone,
ST: SpaceTemporal<VS, VT> + Clone,
SYM: Symbolic + Clone,
VS: Clone,
VT: Clone,{ /* private fields */ }Implementations§
Source§impl<D, S, T, ST, SYM, VS, VT> Context<D, S, T, ST, SYM, VS, VT>
impl<D, S, T, ST, SYM, VS, VT> Context<D, S, T, ST, SYM, VS, VT>
Sourcepub fn with_capacity(id: ContextId, name: &str, capacity: usize) -> Self
pub fn with_capacity(id: ContextId, name: &str, capacity: usize) -> Self
Creates a new context with the given node capacity.
Sourcepub fn get_node_index_by_id(&self, id: ContextoidId) -> Option<usize>
pub fn get_node_index_by_id(&self, id: ContextoidId) -> Option<usize>
Returns the internal graph index for a given ContextoidId. This is useful for mapping external IDs to internal graph indices.
Trait Implementations§
Source§impl<D, S, T, ST, SYM, VS, VT> ContextuableGraph<D, S, T, ST, SYM, VS, VT> for Context<D, S, T, ST, SYM, VS, VT>
impl<D, S, T, ST, SYM, VS, VT> ContextuableGraph<D, S, T, ST, SYM, VS, VT> for Context<D, S, T, ST, SYM, VS, VT>
Source§fn contains_node(&self, index: usize) -> bool
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, SYM, VS, VT>>
fn get_node( &self, index: usize, ) -> Option<&Contextoid<D, S, T, ST, SYM, VS, VT>>
Returns a reference to the contextoid with the given index. If the context does not contain the contextoid, it will return None.
Source§fn add_edge(
&mut self,
a: usize,
b: usize,
weight: RelationKind,
) -> Result<(), ContextIndexError>
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
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>
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 number_of_nodes(&self) -> usize
fn number_of_nodes(&self) -> usize
Returns the number of nodes in the context.
Source§fn number_of_edges(&self) -> usize
fn number_of_edges(&self) -> usize
Returns the number of edges in the context.
fn add_node( &mut self, value: Contextoid<D, S, T, ST, SYM, VS, VT>, ) -> Result<usize, ContextIndexError>
fn remove_node( &mut self, node_id: ContextoidId, ) -> Result<(), ContextIndexError>
fn update_node( &mut self, node_id: ContextoidId, new_node: Contextoid<D, S, T, ST, SYM, VS, VT>, ) -> Result<(), ContextIndexError>
Source§impl<D, S, T, ST, SYM, VS, VT> CurrentDataIndex for Context<D, S, T, ST, SYM, VS, VT>
impl<D, S, T, ST, SYM, VS, VT> CurrentDataIndex for Context<D, S, T, ST, SYM, VS, VT>
Source§impl<D, S, T, ST, SYM, VS, VT> CurrentTimeIndex for Context<D, S, T, ST, SYM, VS, VT>
impl<D, S, T, ST, SYM, VS, VT> CurrentTimeIndex for Context<D, S, T, ST, SYM, VS, VT>
Source§fn set_current_year_index(&mut self, index: usize)
fn set_current_year_index(&mut self, index: usize)
Source§fn set_current_month_index(&mut self, index: usize)
fn set_current_month_index(&mut self, index: usize)
Source§fn set_current_week_index(&mut self, index: usize)
fn set_current_week_index(&mut self, index: usize)
Source§fn set_current_day_index(&mut self, index: usize)
fn set_current_day_index(&mut self, index: usize)
Source§fn set_current_hour_index(&mut self, index: usize)
fn set_current_hour_index(&mut self, index: usize)
Source§fn set_current_minute_index(&mut self, index: usize)
fn set_current_minute_index(&mut self, index: usize)
Source§impl<D, S, T, ST, SYM, VS, VT> DataIndexable for Context<D, S, T, ST, SYM, VS, VT>
impl<D, S, T, ST, SYM, VS, VT> DataIndexable for Context<D, S, T, ST, SYM, VS, VT>
Source§impl<D, S, T, ST, SYM, VS, VT> ExtendableContextuableGraph<D, S, T, ST, SYM, VS, VT> for Context<D, S, T, ST, SYM, VS, VT>
impl<D, S, T, ST, SYM, VS, VT> ExtendableContextuableGraph<D, S, T, ST, SYM, VS, VT> for Context<D, S, T, ST, SYM, VS, VT>
Source§fn extra_ctx_add_new(&mut self, capacity: usize, default: bool) -> u64
fn extra_ctx_add_new(&mut self, capacity: usize, default: bool) -> u64
Source§fn extra_ctx_add_new_with_id(
&mut self,
id: u64,
capacity: usize,
default: bool,
) -> Result<(), ContextIndexError>
fn extra_ctx_add_new_with_id( &mut self, id: u64, capacity: usize, default: bool, ) -> Result<(), ContextIndexError>
Source§fn extra_ctx_check_exists(&self, idx: u64) -> bool
fn extra_ctx_check_exists(&self, idx: u64) -> bool
Source§fn extra_ctx_get_current_id(&self) -> u64
fn extra_ctx_get_current_id(&self) -> u64
Source§fn extra_ctx_set_current_id(
&mut self,
idx: u64,
) -> Result<(), ContextIndexError>
fn extra_ctx_set_current_id( &mut self, idx: u64, ) -> Result<(), ContextIndexError>
Source§fn extra_ctx_unset_current_id(&mut self) -> Result<(), ContextIndexError>
fn extra_ctx_unset_current_id(&mut self) -> Result<(), ContextIndexError>
Source§fn extra_ctx_add_node(
&mut self,
value: Contextoid<D, S, T, ST, SYM, VS, VT>,
) -> Result<usize, ContextIndexError>
fn extra_ctx_add_node( &mut self, value: Contextoid<D, S, T, ST, SYM, VS, VT>, ) -> Result<usize, ContextIndexError>
Contextoid node to the currently active extra context. Read moreSource§fn extra_ctx_contains_node(&self, index: usize) -> bool
fn extra_ctx_contains_node(&self, index: usize) -> bool
Source§fn extra_ctx_get_node(
&self,
index: usize,
) -> Result<&Contextoid<D, S, T, ST, SYM, VS, VT>, ContextIndexError>
fn extra_ctx_get_node( &self, index: usize, ) -> Result<&Contextoid<D, S, T, ST, SYM, VS, VT>, ContextIndexError>
Contextoid from the currently active extra context. Read more