pub struct VirtualSocket { /* private fields */ }Expand description
Virtual socket - unified interface over multiple transport legs
Implementations§
Source§impl VirtualSocket
impl VirtualSocket
Sourcepub fn new(
config: VirtualSocketConfig,
scheduler: Arc<Scheduler>,
fallback: Arc<FallbackStateMachine>,
) -> Self
pub fn new( config: VirtualSocketConfig, scheduler: Arc<Scheduler>, fallback: Arc<FallbackStateMachine>, ) -> Self
Create a new virtual socket
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default configuration
Sourcepub async fn register_leg(&self, leg_type: LegType, leg: Arc<dyn TransportLeg>)
pub async fn register_leg(&self, leg_type: LegType, leg: Arc<dyn TransportLeg>)
Register a transport leg
Sourcepub async fn unregister_leg(
&self,
leg_type: LegType,
) -> Option<Arc<dyn TransportLeg>>
pub async fn unregister_leg( &self, leg_type: LegType, ) -> Option<Arc<dyn TransportLeg>>
Unregister a transport leg
Sourcepub async fn get_leg(&self, leg_type: LegType) -> Option<Arc<dyn TransportLeg>>
pub async fn get_leg(&self, leg_type: LegType) -> Option<Arc<dyn TransportLeg>>
Get a transport leg
Sourcepub async fn send(&self, data: Bytes, is_priority: bool) -> Result<()>
pub async fn send(&self, data: Bytes, is_priority: bool) -> Result<()>
Send data through the virtual socket
The scheduler selects the optimal path(s).
Sourcepub async fn start_recv_loop(&self, leg_type: LegType) -> Result<()>
pub async fn start_recv_loop(&self, leg_type: LegType) -> Result<()>
Start background receive loop for a leg
Sourcepub fn current_mode(&self) -> TransportMode
pub fn current_mode(&self) -> TransportMode
Get current transport mode
Sourcepub async fn available_legs(&self) -> Vec<LegType>
pub async fn available_legs(&self) -> Vec<LegType>
Get available leg types
Sourcepub fn fallback(&self) -> &Arc<FallbackStateMachine>
pub fn fallback(&self) -> &Arc<FallbackStateMachine>
Get fallback state machine reference
Sourcepub fn start_probe_loop(self: Arc<Self>)
pub fn start_probe_loop(self: Arc<Self>)
Start the background probe loop to allow transport healing
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for VirtualSocket
impl !RefUnwindSafe for VirtualSocket
impl !UnwindSafe for VirtualSocket
impl Send for VirtualSocket
impl Sync for VirtualSocket
impl Unpin for VirtualSocket
impl UnsafeUnpin for VirtualSocket
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