#[non_exhaustive]pub struct EdgeState {
pub enabled: bool,
pub effective: bool,
}Expand description
Flags of one registered edge, returned by LifecycleGraph::edge_state.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolThe edge’s own flag, independent of its endpoints.
effective: boolWhether the edge participates in connectivity: enabled, with both endpoints active.
Implementations§
Source§impl EdgeState
impl EdgeState
Sourcepub const fn new(enabled: bool, effective: bool) -> Self
pub const fn new(enabled: bool, effective: bool) -> Self
Creates edge flags with the given values.
LifecycleGraph::edge_state is the normal source of an EdgeState.
This constructor exists because the struct is #[non_exhaustive] (a
future release may add a flag), so code outside this crate cannot use a
struct literal; use it to build expected values in comparisons, for
example in a test or a reference model. The values are not validated:
LifecycleGraph never reports effective without enabled.
use knotrel_core::{EdgeState, EngineConfig, LifecycleGraph};
let mut graph = LifecycleGraph::new(EngineConfig::CompactBfs)?;
graph.link(1, 2)?;
graph.set_node_active(2, false)?;
assert_eq!(graph.edge_state(1, 2), Some(EdgeState::new(true, false)));Trait Implementations§
impl Copy for EdgeState
impl Eq for EdgeState
impl StructuralPartialEq for EdgeState
Auto Trait Implementations§
impl Forget for EdgeState
impl Freeze for EdgeState
impl Move for EdgeState
impl RefUnwindSafe for EdgeState
impl Send for EdgeState
impl Sync for EdgeState
impl Unpin for EdgeState
impl UnsafeUnpin for EdgeState
impl UnwindSafe for EdgeState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more