Skip to main content

SessionSynchronousProxy

Struct SessionSynchronousProxy 

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

Implementations§

Source§

impl SessionSynchronousProxy

Source

pub fn new(channel: Channel) -> Self

Source

pub fn into_channel(self) -> Channel

Source

pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<SessionEvent, 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 read32( &self, resource: u32, offset: u64, ___deadline: MonotonicInstant, ) -> Result<SessionRead32Result, Error>

One policy-checked, audited 32-bit read.

Source

pub fn snapshot( &self, items: &[SnapshotItem], ___deadline: MonotonicInstant, ) -> Result<SessionSnapshotResult, Error>

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

Source

pub fn read_audit( &self, cursor: u64, limit: u32, ___deadline: MonotonicInstant, ) -> Result<(Vec<AuditEntry>, bool, u64, u64), Error>

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

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

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

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

Source

pub fn gpio_read( &self, resource: u32, ___deadline: MonotonicInstant, ) -> Result<SessionGpioReadResult, Error>

One policy-checked, audited GPIO read.

Source

pub fn gpio_write( &self, resource: u32, value: bool, ___deadline: MonotonicInstant, ) -> Result<SessionGpioWriteResult, Error>

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

Source

pub fn i2c_transfer( &self, resource: u32, write_data: &[u8], read_length: u32, ___deadline: MonotonicInstant, ) -> Result<SessionI2cTransferResult, Error>

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

Source

pub fn spi_transmit( &self, resource: u32, tx_data: &[u8], ___deadline: MonotonicInstant, ) -> Result<SessionSpiTransmitResult, Error>

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

Source

pub fn open_gpio( &self, resource: u32, endpoint: ServerEnd<GpioEndpointMarker>, ___deadline: MonotonicInstant, ) -> Result<SessionOpenGpioResult, Error>

Opens a typed GPIO endpoint bound to this session.

Source

pub fn open_i2c( &self, resource: u32, endpoint: ServerEnd<I2cEndpointMarker>, ___deadline: MonotonicInstant, ) -> Result<SessionOpenI2cResult, Error>

Opens a typed I2C endpoint bound to this session.

Source

pub fn open_spi( &self, resource: u32, endpoint: ServerEnd<SpiEndpointMarker>, ___deadline: MonotonicInstant, ) -> Result<SessionOpenSpiResult, Error>

Opens a typed SPI endpoint bound to this session.

Source

pub fn wait_for_interrupt( &self, resource: u32, after_sequence: u64, timeout_ns: i64, ___deadline: MonotonicInstant, ) -> Result<SessionWaitForInterruptResult, Error>

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

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

Source

pub fn clock_disable( &self, resource: u32, ___deadline: MonotonicInstant, ) -> Result<SessionClockDisableResult, Error>

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

Source

pub fn clock_is_enabled( &self, resource: u32, ___deadline: MonotonicInstant, ) -> Result<SessionClockIsEnabledResult, Error>

One policy-checked, audited Clock is_enabled query.

Source

pub fn clock_set_rate( &self, resource: u32, hz: u64, ___deadline: MonotonicInstant, ) -> Result<SessionClockSetRateResult, Error>

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

Source

pub fn clock_query_rate( &self, resource: u32, hz_in: u64, ___deadline: MonotonicInstant, ) -> Result<SessionClockQueryRateResult, Error>

One policy-checked, audited Clock query_supported_rate query.

Source

pub fn clock_get_rate( &self, resource: u32, ___deadline: MonotonicInstant, ) -> Result<SessionClockGetRateResult, Error>

One policy-checked, audited Clock get_rate query.

Source

pub fn reset_assert( &self, resource: u32, ___deadline: MonotonicInstant, ) -> Result<SessionResetAssertResult, Error>

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

Source

pub fn reset_deassert( &self, resource: u32, ___deadline: MonotonicInstant, ) -> Result<SessionResetDeassertResult, Error>

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

Source

pub fn reset_toggle( &self, resource: u32, ___deadline: MonotonicInstant, ) -> Result<SessionResetToggleResult, Error>

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

Source

pub fn reset_status( &self, resource: u32, ___deadline: MonotonicInstant, ) -> Result<SessionResetStatusResult, Error>

One policy-checked, audited Reset status query.

Source

pub fn serial_read( &self, resource: u32, ___deadline: MonotonicInstant, ) -> Result<SessionSerialReadResult, Error>

One policy-checked, audited Serial read.

Source

pub fn serial_write( &self, resource: u32, data: &[u8], ___deadline: MonotonicInstant, ) -> Result<SessionSerialWriteResult, Error>

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

Trait Implementations§

Source§

impl Debug for SessionSynchronousProxy

Source§

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

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

impl From<Channel> for SessionSynchronousProxy

Available on Fuchsia only.
Source§

fn from(value: Channel) -> Self

Converts to this type from the input type.
Source§

impl From<SessionSynchronousProxy> for NullableHandle

Available on Fuchsia only.
Source§

fn from(value: SessionSynchronousProxy) -> Self

Converts to this type from the input type.
Source§

impl FromClient for SessionSynchronousProxy

Available on Fuchsia only.
Source§

type Protocol = SessionMarker

The protocol.
Source§

fn from_client(value: ClientEnd<SessionMarker>) -> Self

Converts from a client.
Source§

impl SynchronousProxy for SessionSynchronousProxy

Available on Fuchsia only.
Source§

type Proxy = SessionProxy

The async proxy for the same protocol.
Source§

type Protocol = SessionMarker

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

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

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.