fidl_fuchsia_hardware_pty

Struct DeviceProxy

Source
pub struct DeviceProxy { /* private fields */ }

Implementations§

Source§

impl DeviceProxy

Source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for fuchsia.hardware.pty/Device.

Source

pub fn take_event_stream(&self) -> DeviceEventStream

Get a Stream of events from the remote end of the protocol.

§Panics

Panics if the event stream was already taken.

Source

pub fn clone2(&self, request: ServerEnd<CloneableMarker>) -> Result<(), Error>

Source

pub fn close( &self, ) -> QueryResponseFut<CloseableCloseResult, DefaultFuchsiaResourceDialect>

Terminates the connection.

After calling Close, the client must not send any other requests.

Servers, after sending the status response, should close the connection regardless of status and without sending an epitaph.

Closing the client end of the channel should be semantically equivalent to calling Close without knowing when the close has completed or its status.

Source

pub fn query(&self) -> QueryResponseFut<Vec<u8>, DefaultFuchsiaResourceDialect>

Source

pub fn read( &self, count: u64, ) -> QueryResponseFut<ReadableReadResult, DefaultFuchsiaResourceDialect>

Reads up to ‘count’ bytes at the seek offset. The seek offset is moved forward by the number of bytes read.

§Invariants
  • The returned data.length will never be greater than count.
  • If data.length is less than count, it means that the seek offset has reached the end of file as part of this operation.
  • If data.length is zero while count is not, it means that the seek offset is already at or beyond the end of file, and no data could be read.
  • If count is zero, the server should perform all the checks ensuring read access without actually read anything, and return an empty data vector.

This method requires the [Rights.READ_BYTES] right.

Returns ZX_ERR_OUT_OF_RANGE if count is greater than MAX_TRANSFER_SIZE.

Source

pub fn write( &self, data: &[u8], ) -> QueryResponseFut<WritableWriteResult, DefaultFuchsiaResourceDialect>

Writes data at the seek offset. The seek offset is moved forward by the number of bytes written. If the file is in append mode, the seek offset is first set to the end of the file, followed by the write, in one atomic step.

The file size may grow if the seek offset plus data.length is beyond the current end of file.

  • request data the byte buffer to write to the file.
  • response actual_count the number of bytes written.
§Invariants
  • The returned actual_count will never be greater than data.length.
  • If the server is unable to write all the data due to e.g. not enough space, actual_count may be less than data.length. If no bytes could be written, an error is returned.
  • If data.length is zero, the server should perform all the checks ensuring write access without mutating the file and return a successful write of zero bytes. The seek offset is still updated if in append mode.

This method requires the [Rights.WRITE_BYTES] right.

Source

pub fn describe( &self, ) -> QueryResponseFut<DeviceDescribeResponse, DefaultFuchsiaResourceDialect>

Source

pub fn open_client( &self, id: u32, client: ServerEnd<DeviceMarker>, ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>

Open a client PTY device with a unique id. client should be a handle to one endpoint of a channel that (on success) will become an open connection to the newly created device. On failure, the channel will be closed. Closing the channel will close the connection and release the device. If the provided id is 0, then the new client is a controlling client and has the capability to open additional clients. If the current device is not a controlling client, ZX_ERR_ACCESS_DENIED will be returned. If id is not unique, ZX_ERR_INVALID_ARGS will be returned. Otherwise the status code from device_add is passed on.

Source

pub fn clr_set_feature( &self, clr: u32, set: u32, ) -> QueryResponseFut<(i32, u32), DefaultFuchsiaResourceDialect>

§allowed on Client PTYs

Clear and/or Set PTY Features

Source

pub fn get_window_size( &self, ) -> QueryResponseFut<(i32, WindowSize), DefaultFuchsiaResourceDialect>

Obtain the window size (in character cells)

Source

pub fn make_active( &self, client_pty_id: u32, ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>

§allowed on the Controlling PTY

Select which Client PTY receives input. Reads will simply block on non-active PTYs.

Source

pub fn read_events( &self, ) -> QueryResponseFut<(i32, u32), DefaultFuchsiaResourceDialect>

Returns pending OOB events, simultaneously clearing them

Source

pub fn set_window_size( &self, size: &WindowSize, ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>

§allowed on the Server PTY

Sets the window size

Trait Implementations§

Source§

impl Clone for DeviceProxy

Source§

fn clone(&self) -> DeviceProxy

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeviceProxy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DeviceProxyInterface for DeviceProxy

Source§

type CloseResponseFut = QueryResponseFut<Result<(), i32>>

Source§

type QueryResponseFut = QueryResponseFut<Vec<u8>>

Source§

type ReadResponseFut = QueryResponseFut<Result<Vec<u8>, i32>>

Source§

type WriteResponseFut = QueryResponseFut<Result<u64, i32>>

Source§

type DescribeResponseFut = QueryResponseFut<DeviceDescribeResponse>

Source§

type OpenClientResponseFut = QueryResponseFut<i32>

Source§

type ClrSetFeatureResponseFut = QueryResponseFut<(i32, u32)>

Source§

type GetWindowSizeResponseFut = QueryResponseFut<(i32, WindowSize)>

Source§

type MakeActiveResponseFut = QueryResponseFut<i32>

Source§

type ReadEventsResponseFut = QueryResponseFut<(i32, u32)>

Source§

type SetWindowSizeResponseFut = QueryResponseFut<i32>

Source§

fn clone2(&self, request: ServerEnd<CloneableMarker>) -> Result<(), Error>

Source§

fn close(&self) -> Self::CloseResponseFut

Source§

fn query(&self) -> Self::QueryResponseFut

Source§

fn read(&self, count: u64) -> Self::ReadResponseFut

Source§

fn write(&self, data: &[u8]) -> Self::WriteResponseFut

Source§

fn describe(&self) -> Self::DescribeResponseFut

Source§

fn open_client( &self, id: u32, client: ServerEnd<DeviceMarker>, ) -> Self::OpenClientResponseFut

Source§

fn clr_set_feature(&self, clr: u32, set: u32) -> Self::ClrSetFeatureResponseFut

Source§

fn get_window_size(&self) -> Self::GetWindowSizeResponseFut

Source§

fn make_active(&self, client_pty_id: u32) -> Self::MakeActiveResponseFut

Source§

fn read_events(&self) -> Self::ReadEventsResponseFut

Source§

fn set_window_size(&self, size: &WindowSize) -> Self::SetWindowSizeResponseFut

Source§

impl Proxy for DeviceProxy

Source§

type Protocol = DeviceMarker

The protocol which this Proxy controls.
Source§

fn from_channel(inner: AsyncChannel) -> Self

Create a proxy over the given channel.
Source§

fn into_channel(self) -> Result<AsyncChannel, Self>

Attempt to convert the proxy back into a channel. Read more
Source§

fn as_channel(&self) -> &AsyncChannel

Get a reference to the proxy’s underlying channel. Read more
§

fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>

Attempt to convert the proxy back into a client end. Read more
§

fn is_closed(&self) -> bool

Returns true if the proxy has received the PEER_CLOSED signal.
§

fn on_closed(&self) -> OnSignals<'_, Unowned<'_, Handle>>

Returns a future that completes when the proxy receives the PEER_CLOSED signal.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> ProxyHasClient for T
where T: Proxy,

§

fn client(&self) -> Result<ZirconClient, Infallible>

Get a “client” for this proxy. This is just an object which has methods for a few common handle creation operations.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more