pub struct SessionProxy { /* private fields */ }
Implementations§
source§impl SessionProxy
impl SessionProxy
sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.network/Session.
sourcepub fn take_event_stream(&self) -> SessionEventStream
pub fn take_event_stream(&self) -> SessionEventStream
Get a Stream of events from the remote end of the protocol.
Panics
Panics if the event stream was already taken.
sourcepub fn attach(
&self,
port: &PortId,
rx_frames: &[FrameType]
) -> QueryResponseFut<SessionAttachResult>
pub fn attach( &self, port: &PortId, rx_frames: &[FrameType] ) -> QueryResponseFut<SessionAttachResult>
Attaches the session to port
.
Once attached, the session starts to receive the subscribed frames over
the data FIFOs and it may send frames destined to the specified port
.
- request
port
port to subscribe to. - request
rx_frames
Frame types of interest on the port.
- error
ZX_ERR_NOT_FOUND
ifport
is not valid. - error
ZX_ERR_INVALID_ARGS
ifrx_frames
is not a subset of the port’s supported frames. - error
ZX_ERR_ALREADY_BOUND
ifport
is already attached.
sourcepub fn detach(&self, port: &PortId) -> QueryResponseFut<SessionDetachResult>
pub fn detach(&self, port: &PortId) -> QueryResponseFut<SessionDetachResult>
Detaches the session from port
.
Once detached, the session stops receiving frames from port
. Frames
sent to a detached port may be returned with an error. It is not
necessary to call Detach
on ports that are removed from the device,
doing so causes ZX_ERR_NOT_FOUND
to be returned.
- request
port
port to subscribe to.
- error
ZX_ERR_NOT_FOUND
if the session is not currently attached to the port.
sourcepub fn close(&self) -> Result<(), Error>
pub fn close(&self) -> Result<(), Error>
Cleanly closes a session.
This will cause the session to send a ZX_ERR_CANCELLED
epitaph and
proceed to close the Session channel. Clients may only assume that they
own all the buffers that are currently owned by the session (sent over
either the rx or tx FIFOs) once the epitaph is received. Closing the rx
or tx FIFO is equivalent to calling Close
.
Trait Implementations§
source§impl Clone for SessionProxy
impl Clone for SessionProxy
source§fn clone(&self) -> SessionProxy
fn clone(&self) -> SessionProxy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SessionProxy
impl Debug for SessionProxy
source§impl Proxy for SessionProxy
impl Proxy for SessionProxy
§type Protocol = SessionMarker
type Protocol = SessionMarker
Proxy
controls.