pub struct VsockService<B> {
connection: Mutex<Option<Weak<Connection<B>>>>,
callback: CallbacksProxy,
scope: Scope,
}
Expand description
Implements the fuchsia.hardware.vsock service against a Connection
.
Fields§
§connection: Mutex<Option<Weak<Connection<B>>>>
§callback: CallbacksProxy
§scope: Scope
Implementations§
Source§impl<B: PacketBuffer> VsockService<B>
impl<B: PacketBuffer> VsockService<B>
Sourcepub async fn wait_for_start(
incoming_connections: Receiver<ConnectionRequest>,
requests: &mut DeviceRequestStream,
) -> Result<Self, Error>
pub async fn wait_for_start( incoming_connections: Receiver<ConnectionRequest>, requests: &mut DeviceRequestStream, ) -> Result<Self, Error>
Waits for the start message from the client and returns a constructed VsockService
Sourcepub async fn set_connection(&self, conn: Arc<Connection<B>>)
pub async fn set_connection(&self, conn: Arc<Connection<B>>)
Set the current connection to be used by the vsock service server.
§Panics
Panics if the current socket is already set.
Sourcefn get_connection(&self) -> Option<Arc<Connection<B>>>
fn get_connection(&self) -> Option<Arc<Connection<B>>>
Gets the current connection if one is set.
async fn send_request(&self, addr: Addr, data: Socket) -> Result<(), Status>
async fn send_shutdown(&self, addr: Addr) -> Result<(), Status>
async fn send_rst(&self, addr: Addr) -> Result<(), Status>
async fn send_response(&self, addr: Addr, data: Socket) -> Result<(), Status>
async fn run_incoming_loop( incoming_connections: Receiver<ConnectionRequest>, proxy: CallbacksProxy, )
Sourcepub async fn run(&self, requests: DeviceRequestStream) -> Result<(), Error>
pub async fn run(&self, requests: DeviceRequestStream) -> Result<(), Error>
Runs the request loop for vsock::DeviceRequest
against whatever the current Connection
is.
Auto Trait Implementations§
impl<B> !Freeze for VsockService<B>
impl<B> !RefUnwindSafe for VsockService<B>
impl<B> Send for VsockService<B>where
B: Send,
impl<B> Sync for VsockService<B>where
B: Send,
impl<B> Unpin for VsockService<B>
impl<B> !UnwindSafe for VsockService<B>
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> IntoAny for T
impl<T> IntoAny for T
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