Skip to main content

SessionRequest

Enum SessionRequest 

Source
pub enum SessionRequest {
Show 27 variants Read32 { resource: u32, offset: u64, responder: SessionRead32Responder, }, Snapshot { items: Vec<SnapshotItem>, responder: SessionSnapshotResponder, }, ReadAudit { cursor: u64, limit: u32, responder: SessionReadAuditResponder, }, Write32 { resource: u32, offset: u64, value: u32, write_mask: u32, precondition: Option<Box<WritePrecondition>>, readback: bool, responder: SessionWrite32Responder, }, Poll32 { resource: u32, offset: u64, expected: u32, mask: u32, interval_ns: i64, timeout_ns: i64, responder: SessionPoll32Responder, }, ExecuteSequence { items: Vec<SequenceItem>, responder: SessionExecuteSequenceResponder, }, GpioRead { resource: u32, responder: SessionGpioReadResponder, }, GpioWrite { resource: u32, value: bool, responder: SessionGpioWriteResponder, }, I2cTransfer { resource: u32, write_data: Vec<u8>, read_length: u32, responder: SessionI2cTransferResponder, }, SpiTransmit { resource: u32, tx_data: Vec<u8>, responder: SessionSpiTransmitResponder, }, OpenGpio { resource: u32, endpoint: ServerEnd<GpioEndpointMarker>, responder: SessionOpenGpioResponder, }, OpenI2c { resource: u32, endpoint: ServerEnd<I2cEndpointMarker>, responder: SessionOpenI2cResponder, }, OpenSpi { resource: u32, endpoint: ServerEnd<SpiEndpointMarker>, responder: SessionOpenSpiResponder, }, WaitForInterrupt { resource: u32, after_sequence: u64, timeout_ns: i64, responder: SessionWaitForInterruptResponder, }, ClockEnable { resource: u32, responder: SessionClockEnableResponder, }, ClockDisable { resource: u32, responder: SessionClockDisableResponder, }, ClockIsEnabled { resource: u32, responder: SessionClockIsEnabledResponder, }, ClockSetRate { resource: u32, hz: u64, responder: SessionClockSetRateResponder, }, ClockQueryRate { resource: u32, hz_in: u64, responder: SessionClockQueryRateResponder, }, ClockGetRate { resource: u32, responder: SessionClockGetRateResponder, }, ResetAssert { resource: u32, responder: SessionResetAssertResponder, }, ResetDeassert { resource: u32, responder: SessionResetDeassertResponder, }, ResetToggle { resource: u32, responder: SessionResetToggleResponder, }, ResetStatus { resource: u32, responder: SessionResetStatusResponder, }, SerialRead { resource: u32, responder: SessionSerialReadResponder, }, SerialWrite { resource: u32, data: Vec<u8>, responder: SessionSerialWriteResponder, },
#[non_exhaustive]
_UnknownMethod { ordinal: u64, control_handle: SessionControlHandle, method_type: MethodType, },
}
Expand description

One experiment session. Closing the channel closes the session, cancels its pending work, and releases the mutation lease.

Variants§

§

Read32

One policy-checked, audited 32-bit read.

Fields

§resource: u32
§offset: u64
§

Snapshot

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

§

ReadAudit

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

Fields

§cursor: u64
§limit: u32
§

Write32

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

Fields

§resource: u32
§offset: u64
§value: u32
§write_mask: u32
§readback: bool
§

Poll32

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

Fields

§resource: u32
§offset: u64
§expected: u32
§mask: u32
§interval_ns: i64
§timeout_ns: i64
§

ExecuteSequence

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

§

GpioRead

One policy-checked, audited GPIO read.

Fields

§resource: u32
§

GpioWrite

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

Fields

§resource: u32
§value: bool
§

I2cTransfer

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

Fields

§resource: u32
§write_data: Vec<u8>
§read_length: u32
§

SpiTransmit

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

Fields

§resource: u32
§tx_data: Vec<u8>
§

OpenGpio

Opens a typed GPIO endpoint bound to this session.

§

OpenI2c

Opens a typed I2C endpoint bound to this session.

Fields

§resource: u32
§

OpenSpi

Opens a typed SPI endpoint bound to this session.

Fields

§resource: u32
§

WaitForInterrupt

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

Fields

§resource: u32
§after_sequence: u64
§timeout_ns: i64
§

ClockEnable

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

Fields

§resource: u32
§

ClockDisable

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

Fields

§resource: u32
§

ClockIsEnabled

One policy-checked, audited Clock is_enabled query.

Fields

§resource: u32
§

ClockSetRate

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

Fields

§resource: u32
§hz: u64
§

ClockQueryRate

One policy-checked, audited Clock query_supported_rate query.

Fields

§resource: u32
§hz_in: u64
§

ClockGetRate

One policy-checked, audited Clock get_rate query.

Fields

§resource: u32
§

ResetAssert

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

Fields

§resource: u32
§

ResetDeassert

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

Fields

§resource: u32
§

ResetToggle

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

Fields

§resource: u32
§

ResetStatus

One policy-checked, audited Reset status query.

Fields

§resource: u32
§

SerialRead

One policy-checked, audited Serial read.

Fields

§resource: u32
§

SerialWrite

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

Fields

§resource: u32
§data: Vec<u8>
§

#[non_exhaustive]
_UnknownMethod

An interaction was received which does not match any known method.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§ordinal: u64

Ordinal of the method that was called.

§control_handle: SessionControlHandle
§method_type: MethodType

Implementations§

Source§

impl SessionRequest

Source

pub fn into_read32(self) -> Option<(u32, u64, SessionRead32Responder)>

Source

pub fn into_snapshot( self, ) -> Option<(Vec<SnapshotItem>, SessionSnapshotResponder)>

Source

pub fn into_read_audit(self) -> Option<(u64, u32, SessionReadAuditResponder)>

Source

pub fn into_write32( self, ) -> Option<(u32, u64, u32, u32, Option<Box<WritePrecondition>>, bool, SessionWrite32Responder)>

Source

pub fn into_poll32( self, ) -> Option<(u32, u64, u32, u32, i64, i64, SessionPoll32Responder)>

Source

pub fn into_execute_sequence( self, ) -> Option<(Vec<SequenceItem>, SessionExecuteSequenceResponder)>

Source

pub fn into_gpio_read(self) -> Option<(u32, SessionGpioReadResponder)>

Source

pub fn into_gpio_write(self) -> Option<(u32, bool, SessionGpioWriteResponder)>

Source

pub fn into_i2c_transfer( self, ) -> Option<(u32, Vec<u8>, u32, SessionI2cTransferResponder)>

Source

pub fn into_spi_transmit( self, ) -> Option<(u32, Vec<u8>, SessionSpiTransmitResponder)>

Source

pub fn into_open_gpio( self, ) -> Option<(u32, ServerEnd<GpioEndpointMarker>, SessionOpenGpioResponder)>

Source

pub fn into_open_i2c( self, ) -> Option<(u32, ServerEnd<I2cEndpointMarker>, SessionOpenI2cResponder)>

Source

pub fn into_open_spi( self, ) -> Option<(u32, ServerEnd<SpiEndpointMarker>, SessionOpenSpiResponder)>

Source

pub fn into_wait_for_interrupt( self, ) -> Option<(u32, u64, i64, SessionWaitForInterruptResponder)>

Source

pub fn into_clock_enable(self) -> Option<(u32, SessionClockEnableResponder)>

Source

pub fn into_clock_disable(self) -> Option<(u32, SessionClockDisableResponder)>

Source

pub fn into_clock_is_enabled( self, ) -> Option<(u32, SessionClockIsEnabledResponder)>

Source

pub fn into_clock_set_rate( self, ) -> Option<(u32, u64, SessionClockSetRateResponder)>

Source

pub fn into_clock_query_rate( self, ) -> Option<(u32, u64, SessionClockQueryRateResponder)>

Source

pub fn into_clock_get_rate(self) -> Option<(u32, SessionClockGetRateResponder)>

Source

pub fn into_reset_assert(self) -> Option<(u32, SessionResetAssertResponder)>

Source

pub fn into_reset_deassert(self) -> Option<(u32, SessionResetDeassertResponder)>

Source

pub fn into_reset_toggle(self) -> Option<(u32, SessionResetToggleResponder)>

Source

pub fn into_reset_status(self) -> Option<(u32, SessionResetStatusResponder)>

Source

pub fn into_serial_read(self) -> Option<(u32, SessionSerialReadResponder)>

Source

pub fn into_serial_write( self, ) -> Option<(u32, Vec<u8>, SessionSerialWriteResponder)>

Source

pub fn method_name(&self) -> &'static str

Name of the method defined in FIDL

Trait Implementations§

Source§

impl Debug for SessionRequest

Source§

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

Formats the value using the given formatter. 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.