pub struct PairByteTransport { /* private fields */ }Expand description
Lossless ByteTransport forwarding capability calls from a dev-machine nv pair server
to the connected remote device over NvWireKind::Rpc and delivering inbound EventPush
frames into DirectEventHub.
Implementations§
Source§impl PairByteTransport
impl PairByteTransport
Sourcepub fn attach(server: &NvWireServer) -> Option<Self>
pub fn attach(server: &NvWireServer) -> Option<Self>
Installs the Rpc | Push peer-event driver on server, forwarding inbound EventPush
frames into DirectEventHub::global. Returns None if server.take_peer_events() was
already claimed.
Sourcepub fn attach_with_event_hub(
server: &NvWireServer,
event_hub: Arc<DirectEventHub>,
sync_timeout: Duration,
) -> Option<Self>
pub fn attach_with_event_hub( server: &NvWireServer, event_hub: Arc<DirectEventHub>, sync_timeout: Duration, ) -> Option<Self>
Same as Self::attach, routing inbound EventPush frames into an explicit
DirectEventHub (ideal for isolated same-process loopback E2E tests).
Sourcepub fn has_connected_peer(&self) -> bool
pub fn has_connected_peer(&self) -> bool
Returns whether at least one remote device peer is currently attached to the RPC lane.
Trait Implementations§
Source§impl ByteTransport for PairByteTransport
impl ByteTransport for PairByteTransport
Source§fn call_sync(
&self,
service_id: u32,
method_id: u32,
req: &[u8],
on_reply: &mut dyn FnMut(&[u8]),
) -> Result<(), TransportError>
fn call_sync( &self, service_id: u32, method_id: u32, req: &[u8], on_reply: &mut dyn FnMut(&[u8]), ) -> Result<(), TransportError>
Synchronously invokes
(service_id, method_id) with req, delivering reply bytes to
on_reply while the transport’s stack or borrowed reply buffer is still live (enabling
zero-allocation reply decoding on the fast path).Source§fn call_async(
&self,
service_id: u32,
method_id: u32,
req: &[u8],
on_done: TransportDoneFn,
)
fn call_async( &self, service_id: u32, method_id: u32, req: &[u8], on_done: TransportDoneFn, )
Initiates an asynchronous invocation of
(service_id, method_id) with req, delivering
the borrowed reply slice or TransportError to on_done exactly once on completion.Source§fn call_async_cancellable(
&self,
service_id: u32,
method_id: u32,
req: &[u8],
on_done: TransportDoneFn,
) -> Option<u64>
fn call_async_cancellable( &self, service_id: u32, method_id: u32, req: &[u8], on_done: TransportDoneFn, ) -> Option<u64>
Initiates an asynchronous invocation and optionally returns a transport-scoped cancellation
handle that may later be passed to
Self::cancel_async.Source§fn cancel_async(&self, call_id: u64)
fn cancel_async(&self, call_id: u64)
Best-effort cancellation of an in-flight asynchronous call started by
Self::call_async_cancellable.Auto Trait Implementations§
impl Forget for PairByteTransport
impl Freeze for PairByteTransportwhere
*const ArcInner<PairTransportInner> is !null: Freeze,
PhantomData<ArcInner<PairTransportInner>>: Freeze,
impl Move for PairByteTransport
impl RefUnwindSafe for PairByteTransportwhere
Atomic<usize>: RefUnwindSafe,
RwLock<Vec<RetainedSnapshot>>: RefUnwindSafe,
RwLock<Vec<RegisteredSurface>>: RefUnwindSafe,
RwLock<Vec<Arc<ObserverSlot>>>: RefUnwindSafe,
Atomic<bool>: RefUnwindSafe,
Atomic<u64>: RefUnwindSafe,
Mutex<VecDeque<u32>>: RefUnwindSafe,
Mutex<HashMap<u64, PendingCall>>: RefUnwindSafe,
Mutex<VecDeque<(u32, Bytes)>>: RefUnwindSafe,
Notify: RefUnwindSafe,
Mutex<Option<JoinHandle<()>>>: RefUnwindSafe,
impl Send for PairByteTransport
impl Sync for PairByteTransport
impl Unpin for PairByteTransport
impl UnsafeUnpin for PairByteTransportwhere
*const ArcInner<PairTransportInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<PairTransportInner>>: UnsafeUnpin,
impl UnwindSafe for PairByteTransportwhere
Arc<PairTransportInner>: UnwindSafe,
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