pub struct Fleet<PlcId> { /* private fields */ }Expand description
Multi-PLC pool built from actor-backed Client handles.
Implementations§
Source§impl<PlcId> Fleet<PlcId>
impl<PlcId> Fleet<PlcId>
Sourcepub async fn connect(&mut self, plc_id: PlcId, addr: &str) -> Result<Client>
pub async fn connect(&mut self, plc_id: PlcId, addr: &str) -> Result<Client>
Connects and adds one PLC by address.
Sourcepub async fn connect_with_route(
&mut self,
plc_id: PlcId,
addr: &str,
route: RoutePath,
) -> Result<Client>
pub async fn connect_with_route( &mut self, plc_id: PlcId, addr: &str, route: RoutePath, ) -> Result<Client>
Connects and adds one routed PLC by address and route path.
Sourcepub fn insert_client(&mut self, plc_id: PlcId, client: Client) -> Option<Client>
pub fn insert_client(&mut self, plc_id: PlcId, client: Client) -> Option<Client>
Inserts an existing actor client into the fleet.
Sourcepub fn client(&self, plc_id: &PlcId) -> Option<Client>
pub fn client(&self, plc_id: &PlcId) -> Option<Client>
Returns a cloneable client handle for one PLC.
Sourcepub fn events(&self) -> Receiver<FleetEvent<PlcId>>
pub fn events(&self) -> Receiver<FleetEvent<PlcId>>
Subscribes to fleet-level connection events.
Sourcepub async fn check_health(&self) -> HashMap<PlcId, Result<bool>>
pub async fn check_health(&self) -> HashMap<PlcId, Result<bool>>
Performs a health check against every PLC currently in the fleet.
Trait Implementations§
Auto Trait Implementations§
impl<PlcId> Freeze for Fleet<PlcId>
impl<PlcId> !RefUnwindSafe for Fleet<PlcId>
impl<PlcId> Send for Fleet<PlcId>where
PlcId: Send,
impl<PlcId> Sync for Fleet<PlcId>
impl<PlcId> Unpin for Fleet<PlcId>where
PlcId: Unpin,
impl<PlcId> UnsafeUnpin for Fleet<PlcId>
impl<PlcId> !UnwindSafe for Fleet<PlcId>
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