pub struct DataChannelProxy { /* private fields */ }
Implementations§
Source§impl DataChannelProxy
impl DataChannelProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.google.nanohub/DataChannel.
Sourcepub fn take_event_stream(&self) -> DataChannelEventStream
pub fn take_event_stream(&self) -> DataChannelEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn register(
&self,
event: Event,
) -> QueryResponseFut<DataChannelRegisterResult, DefaultFuchsiaResourceDialect>
pub fn register( &self, event: Event, ) -> QueryResponseFut<DataChannelRegisterResult, DefaultFuchsiaResourceDialect>
Set event used to signal device state. Discards existing event after having transferred device state to the new event. This must be called before invoking Read or Write, and can fail with ZX_ERR_NO_RESOURCES if the underlying channel is busy.
Sourcepub fn get_identifier(
&self,
) -> QueryResponseFut<DataChannelGetIdentifierResponse, DefaultFuchsiaResourceDialect>
pub fn get_identifier( &self, ) -> QueryResponseFut<DataChannelGetIdentifierResponse, DefaultFuchsiaResourceDialect>
Returns the identifier associated with this connection.
Sourcepub fn read(
&self,
payload: &DataChannelReadRequest,
) -> QueryResponseFut<DataChannelReadResult, DefaultFuchsiaResourceDialect>
pub fn read( &self, payload: &DataChannelReadRequest, ) -> QueryResponseFut<DataChannelReadResult, DefaultFuchsiaResourceDialect>
The call will return the next datagram to be read from the channel. If there is more data to be read, SIGNAL_READABLE will remain asserted after this call returns.
Sourcepub fn write(
&self,
payload: &DataChannelWriteRequest,
) -> QueryResponseFut<DataChannelWriteResult, DefaultFuchsiaResourceDialect>
pub fn write( &self, payload: &DataChannelWriteRequest, ) -> QueryResponseFut<DataChannelWriteResult, DefaultFuchsiaResourceDialect>
The call will return once the data is fully committed.
If the driver is not ready for a write, it will return ZX_ERR_NO_RESOURCES and the caller should await SIGNAL_WRITABLE to be asserted.
Trait Implementations§
Source§impl Clone for DataChannelProxy
impl Clone for DataChannelProxy
Source§fn clone(&self) -> DataChannelProxy
fn clone(&self) -> DataChannelProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl DataChannelProxyInterface for DataChannelProxy
impl DataChannelProxyInterface for DataChannelProxy
type RegisterResponseFut = QueryResponseFut<Result<(), i32>>
type GetIdentifierResponseFut = QueryResponseFut<DataChannelGetIdentifierResponse>
type ReadResponseFut = QueryResponseFut<Result<DataChannelReadResponse, i32>>
type WriteResponseFut = QueryResponseFut<Result<(), i32>>
fn register(&self, event: Event) -> Self::RegisterResponseFut
fn get_identifier(&self) -> Self::GetIdentifierResponseFut
fn read(&self, payload: &DataChannelReadRequest) -> Self::ReadResponseFut
fn write(&self, payload: &DataChannelWriteRequest) -> Self::WriteResponseFut
Source§impl Debug for DataChannelProxy
impl Debug for DataChannelProxy
Source§impl Proxy for DataChannelProxy
impl Proxy for DataChannelProxy
Source§type Protocol = DataChannelMarker
type Protocol = DataChannelMarker
Proxy
controls.