Skip to main content

RouteRollbackGuard

Struct RouteRollbackGuard 

Source
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

Source

pub fn new(allow_reroute: bool) -> RouteRollbackGuard

Source

pub fn allow_reroute(&self) -> bool

Source

pub fn owned_objects(&self) -> &[u32]

Source

pub fn moved_routes(&self) -> &BTreeMap<u32, OwnedRoute>

Source

pub fn require_reroute_permitted( &self, requires_reroute: bool, ) -> Result<(), CapabilityError>

Rejects disruptive route/mute behavior (requires_reroute == true) when allow_reroute == false.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> RouteRollbackGuard

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 RouteRollbackGuard

Source§

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

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

impl Eq for RouteRollbackGuard

Source§

impl PartialEq for RouteRollbackGuard

Source§

fn eq(&self, other: &RouteRollbackGuard) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RouteRollbackGuard

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.