Skip to main content

SessionProxy

Struct SessionProxy 

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

Implementations§

Source§

impl SessionProxy

Source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for fuchsia.driver.lab/Session.

Source

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.

Source

pub fn read32( &self, resource: u32, offset: u64, ) -> QueryResponseFut<SessionRead32Result, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited 32-bit read.

Source

pub fn snapshot( &self, items: &[SnapshotItem], ) -> QueryResponseFut<SessionSnapshotResult, DefaultFuchsiaResourceDialect> ⓘ

Bounded snapshot: every item is validated before the first read.

Source

pub fn read_audit( &self, cursor: u64, limit: u32, ) -> QueryResponseFut<(Vec<AuditEntry>, bool, u64, u64), DefaultFuchsiaResourceDialect> ⓘ

Reads a bounded audit page so the host can drain incrementally and detect gaps.

Source

pub fn write32( &self, resource: u32, offset: u64, value: u32, write_mask: u32, precondition: Option<&WritePrecondition>, readback: bool, ) -> QueryResponseFut<SessionWrite32Result, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited 32-bit write with optional precondition, read-modify-write, barrier, and readback.

Source

pub fn poll32( &self, resource: u32, offset: u64, expected: u32, mask: u32, interval_ns: i64, timeout_ns: i64, ) -> QueryResponseFut<SessionPoll32Result, DefaultFuchsiaResourceDialect> ⓘ

Repeated bounded read until (value & mask) == (expected & mask) or timeout. Uses asynchronous timers on the driver dispatcher.

Source

pub fn execute_sequence( &self, items: &[SequenceItem], ) -> QueryResponseFut<SessionExecuteSequenceResult, DefaultFuchsiaResourceDialect> ⓘ

Bounded ordered sequence of operations. Whole-sequence validation occurs before any hardware operation begins.

Source

pub fn gpio_read( &self, resource: u32, ) -> QueryResponseFut<SessionGpioReadResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited GPIO read.

Source

pub fn gpio_write( &self, resource: u32, value: bool, ) -> QueryResponseFut<SessionGpioWriteResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited GPIO write. Requires mutation lease.

Source

pub fn i2c_transfer( &self, resource: u32, write_data: &[u8], read_length: u32, ) -> QueryResponseFut<SessionI2cTransferResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited I2C transfer. Non-empty write requires mutation lease.

Source

pub fn spi_transmit( &self, resource: u32, tx_data: &[u8], ) -> QueryResponseFut<SessionSpiTransmitResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited SPI transmit. Requires mutation lease.

Source

pub fn open_gpio( &self, resource: u32, endpoint: ServerEnd<GpioEndpointMarker>, ) -> QueryResponseFut<SessionOpenGpioResult, DefaultFuchsiaResourceDialect> ⓘ

Opens a typed GPIO endpoint bound to this session.

Source

pub fn open_i2c( &self, resource: u32, endpoint: ServerEnd<I2cEndpointMarker>, ) -> QueryResponseFut<SessionOpenI2cResult, DefaultFuchsiaResourceDialect> ⓘ

Opens a typed I2C endpoint bound to this session.

Source

pub fn open_spi( &self, resource: u32, endpoint: ServerEnd<SpiEndpointMarker>, ) -> QueryResponseFut<SessionOpenSpiResult, DefaultFuchsiaResourceDialect> ⓘ

Opens a typed SPI endpoint bound to this session.

Source

pub fn wait_for_interrupt( &self, resource: u32, after_sequence: u64, timeout_ns: i64, ) -> QueryResponseFut<SessionWaitForInterruptResult, DefaultFuchsiaResourceDialect> ⓘ

Observes an interrupt event. Bounded hanging request that yields when the interrupt sequence exceeds after_sequence or upon timeout.

Source

pub fn clock_enable( &self, resource: u32, ) -> QueryResponseFut<SessionClockEnableResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Clock enable. Requires mutation lease.

Source

pub fn clock_disable( &self, resource: u32, ) -> QueryResponseFut<SessionClockDisableResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Clock disable. Requires mutation lease.

Source

pub fn clock_is_enabled( &self, resource: u32, ) -> QueryResponseFut<SessionClockIsEnabledResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Clock is_enabled query.

Source

pub fn clock_set_rate( &self, resource: u32, hz: u64, ) -> QueryResponseFut<SessionClockSetRateResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Clock set_rate. Requires mutation lease.

Source

pub fn clock_query_rate( &self, resource: u32, hz_in: u64, ) -> QueryResponseFut<SessionClockQueryRateResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Clock query_supported_rate query.

Source

pub fn clock_get_rate( &self, resource: u32, ) -> QueryResponseFut<SessionClockGetRateResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Clock get_rate query.

Source

pub fn reset_assert( &self, resource: u32, ) -> QueryResponseFut<SessionResetAssertResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Reset assert. Requires mutation lease.

Source

pub fn reset_deassert( &self, resource: u32, ) -> QueryResponseFut<SessionResetDeassertResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Reset deassert. Requires mutation lease.

Source

pub fn reset_toggle( &self, resource: u32, ) -> QueryResponseFut<SessionResetToggleResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Reset toggle. Requires mutation lease.

Source

pub fn reset_status( &self, resource: u32, ) -> QueryResponseFut<SessionResetStatusResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Reset status query.

Source

pub fn serial_read( &self, resource: u32, ) -> QueryResponseFut<SessionSerialReadResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Serial read.

Source

pub fn serial_write( &self, resource: u32, data: &[u8], ) -> QueryResponseFut<SessionSerialWriteResult, DefaultFuchsiaResourceDialect> ⓘ

One policy-checked, audited Serial write. Requires mutation lease.

Trait Implementations§

Source§

impl Clone for SessionProxy

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionProxy

Source§

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

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

impl Proxy for SessionProxy

Source§

type Protocol = SessionMarker

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

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

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

fn is_closed(&self) -> bool

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

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

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

impl SessionProxyInterface for SessionProxy

Source§

type Read32ResponseFut = QueryResponseFut<Result<(u32, u64, i64), OperationError>>

Source§

type SnapshotResponseFut = QueryResponseFut<Result<(Vec<SnapshotItemResult>, bool), OperationError>>

Source§

type ReadAuditResponseFut = QueryResponseFut<(Vec<AuditEntry>, bool, u64, u64)>

Source§

type Write32ResponseFut = QueryResponseFut<Result<(u32, u64, i64), OperationError>>

Source§

type Poll32ResponseFut = QueryResponseFut<Result<(u32, u64, i64), OperationError>>

Source§

type ExecuteSequenceResponseFut = QueryResponseFut<Result<(Vec<SequenceItemResult>, bool), OperationError>>

Source§

type GpioReadResponseFut = QueryResponseFut<Result<(bool, u64, i64), OperationError>>

Source§

type GpioWriteResponseFut = QueryResponseFut<Result<(u64, i64), OperationError>>

Source§

type I2cTransferResponseFut = QueryResponseFut<Result<(Vec<u8>, u64, i64), OperationError>>

Source§

type SpiTransmitResponseFut = QueryResponseFut<Result<(Vec<u8>, u64, i64), OperationError>>

Source§

type OpenGpioResponseFut = QueryResponseFut<Result<(), OperationError>>

Source§

type OpenI2cResponseFut = QueryResponseFut<Result<(), OperationError>>

Source§

type OpenSpiResponseFut = QueryResponseFut<Result<(), OperationError>>

Source§

type WaitForInterruptResponseFut = QueryResponseFut<Result<(u32, u64, u64, i64, u64), OperationError>>

Source§

type ClockEnableResponseFut = QueryResponseFut<Result<(u64, i64), OperationError>>

Source§

type ClockDisableResponseFut = QueryResponseFut<Result<(u64, i64), OperationError>>

Source§

type ClockIsEnabledResponseFut = QueryResponseFut<Result<(bool, u64, i64), OperationError>>

Source§

type ClockSetRateResponseFut = QueryResponseFut<Result<(u64, i64), OperationError>>

Source§

type ClockQueryRateResponseFut = QueryResponseFut<Result<(u64, u64, i64), OperationError>>

Source§

type ClockGetRateResponseFut = QueryResponseFut<Result<(u64, u64, i64), OperationError>>

Source§

type ResetAssertResponseFut = QueryResponseFut<Result<(u64, i64), OperationError>>

Source§

type ResetDeassertResponseFut = QueryResponseFut<Result<(u64, i64), OperationError>>

Source§

type ResetToggleResponseFut = QueryResponseFut<Result<(u64, i64), OperationError>>

Source§

type ResetStatusResponseFut = QueryResponseFut<Result<(bool, u64, i64), OperationError>>

Source§

type SerialReadResponseFut = QueryResponseFut<Result<(Vec<u8>, u64, i64), OperationError>>

Source§

type SerialWriteResponseFut = QueryResponseFut<Result<(u64, i64), OperationError>>

Source§

fn read32(&self, resource: u32, offset: u64) -> Self::Read32ResponseFut

Source§

fn snapshot(&self, items: &[SnapshotItem]) -> Self::SnapshotResponseFut

Source§

fn read_audit(&self, cursor: u64, limit: u32) -> Self::ReadAuditResponseFut

Source§

fn write32( &self, resource: u32, offset: u64, value: u32, write_mask: u32, precondition: Option<&WritePrecondition>, readback: bool, ) -> Self::Write32ResponseFut

Source§

fn poll32( &self, resource: u32, offset: u64, expected: u32, mask: u32, interval_ns: i64, timeout_ns: i64, ) -> Self::Poll32ResponseFut

Source§

fn execute_sequence( &self, items: &[SequenceItem], ) -> Self::ExecuteSequenceResponseFut

Source§

fn gpio_read(&self, resource: u32) -> Self::GpioReadResponseFut

Source§

fn gpio_write(&self, resource: u32, value: bool) -> Self::GpioWriteResponseFut

Source§

fn i2c_transfer( &self, resource: u32, write_data: &[u8], read_length: u32, ) -> Self::I2cTransferResponseFut

Source§

fn spi_transmit( &self, resource: u32, tx_data: &[u8], ) -> Self::SpiTransmitResponseFut

Source§

fn open_gpio( &self, resource: u32, endpoint: ServerEnd<GpioEndpointMarker>, ) -> Self::OpenGpioResponseFut

Source§

fn open_i2c( &self, resource: u32, endpoint: ServerEnd<I2cEndpointMarker>, ) -> Self::OpenI2cResponseFut

Source§

fn open_spi( &self, resource: u32, endpoint: ServerEnd<SpiEndpointMarker>, ) -> Self::OpenSpiResponseFut

Source§

fn wait_for_interrupt( &self, resource: u32, after_sequence: u64, timeout_ns: i64, ) -> Self::WaitForInterruptResponseFut

Source§

fn clock_enable(&self, resource: u32) -> Self::ClockEnableResponseFut

Source§

fn clock_disable(&self, resource: u32) -> Self::ClockDisableResponseFut

Source§

fn clock_is_enabled(&self, resource: u32) -> Self::ClockIsEnabledResponseFut

Source§

fn clock_set_rate( &self, resource: u32, hz: u64, ) -> Self::ClockSetRateResponseFut

Source§

fn clock_query_rate( &self, resource: u32, hz_in: u64, ) -> Self::ClockQueryRateResponseFut

Source§

fn clock_get_rate(&self, resource: u32) -> Self::ClockGetRateResponseFut

Source§

fn reset_assert(&self, resource: u32) -> Self::ResetAssertResponseFut

Source§

fn reset_deassert(&self, resource: u32) -> Self::ResetDeassertResponseFut

Source§

fn reset_toggle(&self, resource: u32) -> Self::ResetToggleResponseFut

Source§

fn reset_status(&self, resource: u32) -> Self::ResetStatusResponseFut

Source§

fn serial_read(&self, resource: u32) -> Self::SerialReadResponseFut

Source§

fn serial_write( &self, resource: u32, data: &[u8], ) -> Self::SerialWriteResponseFut

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, dest: *mut u8)

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

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

Source§

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, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

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.

Source§

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

Source§

type Protocol = <T as Proxy>::Protocol

The protocol.
Source§

fn from_client(value: ClientEnd<<T as FromClient>::Protocol>) -> T

Converts from a client.
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> ProxyHasDomain for T
where T: Proxy,

Source§

fn domain(&self) -> ZirconClient

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

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

fn try_from(value: U) -> Result<T, !>

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.