fidl_fuchsia_hardware_pty

Struct DeviceSynchronousProxy

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

Implementations§

Source§

impl DeviceSynchronousProxy

Source

pub fn new(channel: Channel) -> Self

Source

pub fn into_channel(self) -> Channel

Source

pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<DeviceEvent, Error>

Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.

Source

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

Source

pub fn close( &self, ___deadline: MonotonicInstant, ) -> Result<CloseableCloseResult, Error>

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, ___deadline: MonotonicInstant) -> Result<Vec<u8>, Error>

Source

pub fn read( &self, count: u64, ___deadline: MonotonicInstant, ) -> Result<ReadableReadResult, Error>

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], ___deadline: MonotonicInstant, ) -> Result<WritableWriteResult, Error>

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, ___deadline: MonotonicInstant, ) -> Result<DeviceDescribeResponse, Error>

Source

pub fn open_client( &self, id: u32, client: ServerEnd<DeviceMarker>, ___deadline: MonotonicInstant, ) -> Result<i32, Error>

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, ___deadline: MonotonicInstant, ) -> Result<(i32, u32), Error>

§allowed on Client PTYs

Clear and/or Set PTY Features

Source

pub fn get_window_size( &self, ___deadline: MonotonicInstant, ) -> Result<(i32, WindowSize), Error>

Obtain the window size (in character cells)

Source

pub fn make_active( &self, client_pty_id: u32, ___deadline: MonotonicInstant, ) -> Result<i32, Error>

§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, ___deadline: MonotonicInstant, ) -> Result<(i32, u32), Error>

Returns pending OOB events, simultaneously clearing them

Source

pub fn set_window_size( &self, size: &WindowSize, ___deadline: MonotonicInstant, ) -> Result<i32, Error>

§allowed on the Server PTY

Sets the window size

Trait Implementations§

Source§

impl Debug for DeviceSynchronousProxy

Source§

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

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

impl SynchronousProxy for DeviceSynchronousProxy

Source§

type Proxy = DeviceProxy

The async proxy for the same protocol.
Source§

type Protocol = DeviceMarker

The protocol which this Proxy controls.
Source§

fn from_channel(inner: Channel) -> Self

Create a proxy over the given channel.
Source§

fn into_channel(self) -> Channel

Convert the proxy back into a channel.
Source§

fn as_channel(&self) -> &Channel

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

fn is_closed(&self) -> Result<bool, Status>

Returns true if the proxy has received the PEER_CLOSED signal. Read more

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
§

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
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