pub struct HostVsockEndpointSynchronousProxy { /* private fields */ }
Implementations§
Source§impl HostVsockEndpointSynchronousProxy
impl HostVsockEndpointSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<HostVsockEndpointEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<HostVsockEndpointEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn listen(
&self,
port: u32,
acceptor: ClientEnd<HostVsockAcceptorMarker>,
___deadline: MonotonicInstant,
) -> Result<HostVsockEndpointListenResult, Error>
pub fn listen( &self, port: u32, acceptor: ClientEnd<HostVsockAcceptorMarker>, ___deadline: MonotonicInstant, ) -> Result<HostVsockEndpointListenResult, Error>
Instructs the device to listen for guest initiated connections to a given port by
using acceptor
when the guest creates a connection.
Possible errors: - ZX_ERR_ALREADY_BOUND: A client is already listening on this port.
Sourcepub fn connect(
&self,
guest_port: u32,
___deadline: MonotonicInstant,
) -> Result<HostVsockEndpointConnectResult, Error>
pub fn connect( &self, guest_port: u32, ___deadline: MonotonicInstant, ) -> Result<HostVsockEndpointConnectResult, Error>
Attempts to create a vsock connection to a guest on ‘guest_port’. Uses a dynamically chosen ephemeral host port.
Possible errors: - ZX_ERR_NO_RESOURCES: The device couldn’t allocate an unused host port. - ZX_ERR_CONNECTION_REFUSED: The guest refused this connection.
Other errors are related to socket creation, see zx_socket_create
Trait Implementations§
Source§impl SynchronousProxy for HostVsockEndpointSynchronousProxy
impl SynchronousProxy for HostVsockEndpointSynchronousProxy
Source§type Proxy = HostVsockEndpointProxy
type Proxy = HostVsockEndpointProxy
The async proxy for the same protocol.
Source§type Protocol = HostVsockEndpointMarker
type Protocol = HostVsockEndpointMarker
The protocol which this
Proxy
controls.Source§fn from_channel(inner: Channel) -> Self
fn from_channel(inner: Channel) -> Self
Create a proxy over the given channel.
Source§fn into_channel(self) -> Channel
fn into_channel(self) -> Channel
Convert the proxy back into a channel.
Source§fn as_channel(&self) -> &Channel
fn as_channel(&self) -> &Channel
Get a reference to the proxy’s underlying channel. Read more
Auto Trait Implementations§
impl Freeze for HostVsockEndpointSynchronousProxy
impl RefUnwindSafe for HostVsockEndpointSynchronousProxy
impl Send for HostVsockEndpointSynchronousProxy
impl Sync for HostVsockEndpointSynchronousProxy
impl Unpin for HostVsockEndpointSynchronousProxy
impl UnwindSafe for HostVsockEndpointSynchronousProxy
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