Skip to main content

DeploymentRouteTable

Struct DeploymentRouteTable 

Source
pub struct DeploymentRouteTable { /* private fields */ }
Expand description

Bounded station-to-node deployment route table.

Implementations§

Source§

impl DeploymentRouteTable

Source

pub fn new(config: DeploymentConfig) -> Self

Creates an empty deployment route table.

Source

pub const fn config(&self) -> DeploymentConfig

Returns configuration.

Source

pub const fn stats(&self) -> DeploymentStats

Returns statistics.

Source

pub fn node_len(&self) -> usize

Returns registered node count.

Source

pub fn station_len(&self) -> usize

Returns station route count.

Source

pub fn register_node( &mut self, node_id: NodeId, station_capacity: usize, now: Tick, ) -> Result<DeploymentNodeRoute, DeploymentError>

Registers or refreshes a node.

Source

pub fn heartbeat( &mut self, node_id: NodeId, now: Tick, ) -> Result<DeploymentNodeRoute, DeploymentError>

Updates a node heartbeat.

Source

pub fn mark_draining( &mut self, node_id: NodeId, ) -> Result<DeploymentNodeRoute, DeploymentError>

Marks a node draining. Existing station routes remain valid.

Source

pub fn mark_offline( &mut self, node_id: NodeId, ) -> Result<DeploymentNodeRoute, DeploymentError>

Marks a node offline. Station routes are retained for explicit remediation by the embedder.

Source

pub fn assign_station( &mut self, station_id: StationId, node_id: NodeId, now: Tick, ) -> Result<DeploymentStationRoute, DeploymentError>

Assigns a station to an online node.

Source

pub fn move_station( &mut self, station_id: StationId, target_node: NodeId, now: Tick, ) -> Result<DeploymentStationMove, DeploymentError>

Moves an existing station route to another online node.

Source

pub fn unassign_station( &mut self, station_id: StationId, ) -> Result<DeploymentStationRoute, DeploymentError>

Removes one station route.

Source

pub fn node_route( &self, node_id: NodeId, ) -> Result<DeploymentNodeRoute, DeploymentError>

Returns a node route.

Source

pub fn station_route( &self, station_id: StationId, ) -> Result<DeploymentStationRoute, DeploymentError>

Returns a station route.

Source

pub fn stations_on_node( &self, node_id: NodeId, ) -> Result<Vec<StationId>, DeploymentError>

Returns station ids assigned to a node.

Source

pub fn resolve_gateway_route( &self, route: GatewayRoute, ) -> Result<GatewayDeliveryRoute, DeploymentError>

Resolves a gateway route to deployment node/station metadata.

Draining nodes remain valid for existing station routes; offline nodes are rejected so embedders can reroute or fail over explicitly.

Source

pub fn resolve_gateway_client( &self, gateway: &GatewaySessionTable, client_id: ClientId, ) -> Result<GatewayDeliveryRoute, GatewayDeliveryError>

Resolves a connected gateway client to deployment node/station metadata.

Source

pub fn stale_nodes(&self, now: Tick) -> Vec<NodeId>

Returns stale node ids without mutating node state.

Source

pub fn mark_stale_offline(&mut self, now: Tick) -> usize

Marks stale nodes offline.

Trait Implementations§

Source§

impl Clone for DeploymentRouteTable

Source§

fn clone(&self) -> DeploymentRouteTable

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeploymentRouteTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DeploymentRouteTable

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.