pub struct RouteRollbackGuard { /* private fields */ }Expand description
Cross-platform route-restoration guard enforcing non-disruptive capture by default
(allow_reroute = false) and restoring only library-owned route/mute/sink changes on
partial-open failure or teardown without overwriting concurrent user route moves.
Implementations§
Source§impl RouteRollbackGuard
impl RouteRollbackGuard
pub fn new(allow_reroute: bool) -> RouteRollbackGuard
pub fn allow_reroute(&self) -> bool
pub fn owned_objects(&self) -> &[u32]
pub fn moved_routes(&self) -> &BTreeMap<u32, OwnedRoute>
Sourcepub fn require_reroute_permitted(
&self,
requires_reroute: bool,
) -> Result<(), CapabilityError>
pub fn require_reroute_permitted( &self, requires_reroute: bool, ) -> Result<(), CapabilityError>
Rejects disruptive route/mute behavior (requires_reroute == true) when allow_reroute == false.
Sourcepub fn record_owned_object(&mut self, object_id: u32)
pub fn record_owned_object(&mut self, object_id: u32)
Track an owned temporary native object (virtual sink, module, tap, or aggregate device)
so plan_rollback destroys/unloads owned objects in deterministic LIFO order.
Sourcepub fn record_route_change(
&mut self,
subject_id: u32,
original_destination: impl Into<Arc<str>>,
temporary_destination: impl Into<Arc<str>>,
was_muted: bool,
) -> Result<(), CapabilityError>
pub fn record_route_change( &mut self, subject_id: u32, original_destination: impl Into<Arc<str>>, temporary_destination: impl Into<Arc<str>>, was_muted: bool, ) -> Result<(), CapabilityError>
Record a stream or object route/mute modification. Rejects with RerouteNotPermitted
when allow_reroute == false.
Sourcepub fn plan_rollback(
&mut self,
live_destinations: &BTreeMap<u32, Arc<str>>,
) -> (Vec<(u32, Arc<str>)>, Vec<u32>)
pub fn plan_rollback( &mut self, live_destinations: &BTreeMap<u32, Arc<str>>, ) -> (Vec<(u32, Arc<str>)>, Vec<u32>)
Compute deterministic rollback actions (restore_moves, destroy_object_ids_lifo) given
the current live subject_id -> destination map. Only subjects still pointing to
temporary_destination are moved back to original_destination; concurrent user route
changes are preserved.
Trait Implementations§
Source§impl Clone for RouteRollbackGuard
impl Clone for RouteRollbackGuard
Source§fn clone(&self) -> RouteRollbackGuard
fn clone(&self) -> RouteRollbackGuard
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more