pub struct SameHostTracker { /* private fields */ }Expand description
Tracker for all (WriterGuid, ReaderGuid) same-host pairs of the
local participant. Thread-safe via an inner mutex.
The API is deliberately minimal: register_pending, mark_bound,
mark_failed, lookup. More complex operations (iteration,
cleanup-on-drop) are left to the caller.
Implementations§
Source§impl SameHostTracker
impl SameHostTracker
Sourcepub fn register_pending(&self, writer: Guid, reader: Guid)
pub fn register_pending(&self, writer: Guid, reader: Guid)
Registers a pair in the Pending state. Idempotent — an existing
entry is not overwritten (so that a Bound state is not
accidentally reset).
Sourcepub fn mark_bound(
&self,
writer: Guid,
reader: Guid,
transport: Arc<dyn Any + Send + Sync>,
role: Role,
)
pub fn mark_bound( &self, writer: Guid, reader: Guid, transport: Arc<dyn Any + Send + Sync>, role: Role, )
Marks a pair as Bound with a transport handle and role.
Overwrites any previous state.
Sourcepub fn mark_failed(&self, writer: Guid, reader: Guid, reason: &'static str)
pub fn mark_failed(&self, writer: Guid, reader: Guid, reason: &'static str)
Marks a pair as Failed. The caller (hot path) should then choose
the UDP fallback.
Sourcepub fn lookup(&self, writer: Guid, reader: Guid) -> Option<SameHostState>
pub fn lookup(&self, writer: Guid, reader: Guid) -> Option<SameHostState>
Returns a copy of the state for a pair.
Trait Implementations§
Source§impl Debug for SameHostTracker
Available on crate feature std only.
impl Debug for SameHostTracker
Available on crate feature
std only.Auto Trait Implementations§
impl !Freeze for SameHostTracker
impl RefUnwindSafe for SameHostTracker
impl Send for SameHostTracker
impl Sync for SameHostTracker
impl Unpin for SameHostTracker
impl UnsafeUnpin for SameHostTracker
impl UnwindSafe for SameHostTracker
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