pub struct Circuits { /* private fields */ }Expand description
The circuit tree of one site, with the lookups the arbiter needs.
Implementations§
Source§impl Circuits
impl Circuits
Sourcepub fn new(circuits: Vec<Circuit>) -> Result<Self, SiteError>
pub fn new(circuits: Vec<Circuit>) -> Result<Self, SiteError>
Build from a list, checking that the result is a tree.
§Errors
SiteError::DuplicateId for a repeated name,
SiteError::UnknownParent for a dangling parent,
SiteError::CircuitCycle when the parent links form a cycle.
Sourcepub fn path_to_root(&self, id: &CircuitId) -> Vec<&Circuit>
pub fn path_to_root(&self, id: &CircuitId) -> Vec<&Circuit>
The circuits from id up to the root, innermost first.
Every limit on this path binds the asset, so the arbiter intersects them.
Sourcepub fn path_for_asset(&self, asset: &Asset) -> Vec<&Circuit>
pub fn path_for_asset(&self, asset: &Asset) -> Vec<&Circuit>
The circuits that lie between asset’s circuit and the root.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Circuits
impl<'de> Deserialize<'de> for Circuits
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Circuits
Auto Trait Implementations§
impl Freeze for Circuits
impl RefUnwindSafe for Circuits
impl Send for Circuits
impl Sync for Circuits
impl Unpin for Circuits
impl UnsafeUnpin for Circuits
impl UnwindSafe for Circuits
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