pub struct SwitchboardCore<S: Solver = DefaultSolver> { /* private fields */ }Expand description
In-memory state tracker for endpoints and intents.
Implementations§
Source§impl<S> SwitchboardCore<S>where
S: Solver,
impl<S> SwitchboardCore<S>where
S: Solver,
Sourcepub fn add_endpoint(&mut self, directions: EndpointDirections) -> EndpointId
pub fn add_endpoint(&mut self, directions: EndpointDirections) -> EndpointId
Register a new endpoint and return its identifier.
Sourcepub fn remove_endpoint(&mut self, endpoint_id: EndpointId)
pub fn remove_endpoint(&mut self, endpoint_id: EndpointId)
Remove an endpoint and any intents referencing it.
Sourcepub fn endpoints(&self) -> &HashMap<EndpointId, EndpointDirections>
pub fn endpoints(&self) -> &HashMap<EndpointId, EndpointDirections>
Access the registered endpoints.
Sourcepub fn add_intent(
&mut self,
from: EndpointId,
to: EndpointId,
) -> Result<(), SwitchboardError>
pub fn add_intent( &mut self, from: EndpointId, to: EndpointId, ) -> Result<(), SwitchboardError>
Add a new intent between endpoints.
Sourcepub fn remove_intent(&mut self, from: EndpointId, to: EndpointId)
pub fn remove_intent(&mut self, from: EndpointId, to: EndpointId)
Remove a previously registered intent.
Sourcepub fn solve(&self) -> Result<Solution, SwitchboardError>
pub fn solve(&self) -> Result<Solution, SwitchboardError>
Solve the current wiring plan.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for SwitchboardCore<S>where
S: Freeze,
impl<S> RefUnwindSafe for SwitchboardCore<S>where
S: RefUnwindSafe,
impl<S> Send for SwitchboardCore<S>where
S: Send,
impl<S> Sync for SwitchboardCore<S>where
S: Sync,
impl<S> Unpin for SwitchboardCore<S>where
S: Unpin,
impl<S> UnsafeUnpin for SwitchboardCore<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for SwitchboardCore<S>where
S: UnwindSafe,
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