pub struct VsockHost { /* private fields */ }Expand description
Host-side virtio-vsock multiplexer bridged to wasm_driver_vsock_*.
Implementations§
Source§impl VsockHost
impl VsockHost
pub fn new(raise_irq: Arc<dyn Fn() + Send + Sync>) -> Arc<Self> ⓘ
Sourcepub fn driver_init(&self, guest_cid: u32, rx_max: u32) -> i32
pub fn driver_init(&self, guest_cid: u32, rx_max: u32) -> i32
Called from wasm_driver_vsock_init(guest_cid, rx_max).
Sourcepub fn driver_rx_len(&self) -> i32
pub fn driver_rx_len(&self) -> i32
Called from wasm_driver_vsock_rx_len().
Sourcepub fn driver_recv(&self) -> Option<Vec<u8>>
pub fn driver_recv(&self) -> Option<Vec<u8>>
Called from wasm_driver_vsock_recv().
Sourcepub fn driver_send(self: &Arc<Self>, pkt: &[u8]) -> i32
pub fn driver_send(self: &Arc<Self>, pkt: &[u8]) -> i32
Called from wasm_driver_vsock_send(pkt) when the guest transmits a packet to the host.
Sourcepub fn listen<F>(&self, port: u32, handler: F)
pub fn listen<F>(&self, port: u32, handler: F)
Register a host listener on port (e.g. 564 for 9P2000.L).
Auto Trait Implementations§
impl !Freeze for VsockHost
impl !RefUnwindSafe for VsockHost
impl !UnwindSafe for VsockHost
impl Forget for VsockHost
impl Move for VsockHost
impl Send for VsockHost
impl Sync for VsockHost
impl Unpin for VsockHost
impl UnsafeUnpin for VsockHostwhere
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Vec<u8>>: UnsafeUnpin,
PhantomData<((u32, u32), Arc<ConnHandle>)>: UnsafeUnpin,
PhantomData<(u32, Arc<dyn Fn(VsockStream) + Send + Sync>)>: UnsafeUnpin,
*const ArcInner<dyn Fn() + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn() + Send + Sync>>: UnsafeUnpin,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more