Skip to main content

GpioLocalServerHandler

Trait GpioLocalServerHandler 

Source
pub trait GpioLocalServerHandler<___T: Transport = Channel> {
    // Required methods
    fn read(
        &mut self,
        responder: Responder<Read, ___T>,
    ) -> impl Future<Output = ()>;
    fn set_buffer_mode(
        &mut self,
        request: Request<SetBufferMode, ___T>,
        responder: Responder<SetBufferMode, ___T>,
    ) -> impl Future<Output = ()>;
    fn get_interrupt(
        &mut self,
        request: Request<GetInterrupt, ___T>,
        responder: Responder<GetInterrupt, ___T>,
    ) -> impl Future<Output = ()>;
    fn configure_interrupt(
        &mut self,
        request: Request<ConfigureInterrupt, ___T>,
        responder: Responder<ConfigureInterrupt, ___T>,
    ) -> impl Future<Output = ()>;
    fn release_interrupt(
        &mut self,
        responder: Responder<ReleaseInterrupt, ___T>,
    ) -> impl Future<Output = ()>;

    // Provided method
    fn on_unknown_interaction(
        &mut self,
        ordinal: u64,
    ) -> impl Future<Output = ()> { ... }
}
Expand description

A server handler for the Gpio protocol.

See Gpio for more details.

Required Methods§

Source

fn read(&mut self, responder: Responder<Read, ___T>) -> impl Future<Output = ()>

Reads the current value of a GPIO, returning true for a high voltage and false for a low voltage.

Source

fn set_buffer_mode( &mut self, request: Request<SetBufferMode, ___T>, responder: Responder<SetBufferMode, ___T>, ) -> impl Future<Output = ()>

Configures the output buffer as per mode.

Source

fn get_interrupt( &mut self, request: Request<GetInterrupt, ___T>, responder: Responder<GetInterrupt, ___T>, ) -> impl Future<Output = ()>

Gets an interrupt object pertaining to a particular GPIO pin. Only one interrupt may be outstanding per pin, and it must be released by calling ReleaseInterrupt() before the next call to GetInterrupt() will succeed. The interrupt is unmasked prior to being returned to the caller.

Returns ZX_ERR_ALREADY_EXISTS if GetInterrupt() has already been called without a subsequent call to ReleaseInterrupt(), ZX_ERR_INVALID_ARGS if options is invalid, or ZX_ERR_ACCESS_DENIED if another client has the interrupt.

Source

fn configure_interrupt( &mut self, request: Request<ConfigureInterrupt, ___T>, responder: Responder<ConfigureInterrupt, ___T>, ) -> impl Future<Output = ()>

Configures the polarity of an interrupt and whether it is edge- or level-triggered. Only the client with the interrupt can call ConfigureInterrupt(), unless no client has an interrupt.

Returns ZX_ERR_INVALID_ARGS if no fields are set in config, or ZX_ERR_ACCESS_DENIED if another client has the interrupt.

Source

fn release_interrupt( &mut self, responder: Responder<ReleaseInterrupt, ___T>, ) -> impl Future<Output = ()>

Releases the interrupt, allowing GetInterrupt() to be called again or by another client. A client’s interrupt is automatically released when it disconnects from the server. The interrupt is masked upon release.

Returns ZX_ERR_NOT_FOUND if the interrupt has already been released, or if GetInterrupt() has not been called. Returns ZX_ERR_ACCESS_DENIED if another client has the interrupt.

Provided Methods§

Source

fn on_unknown_interaction(&mut self, ordinal: u64) -> impl Future<Output = ()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<___H, ___T> GpioLocalServerHandler<___T> for Local<___H>
where ___H: GpioServerHandler<___T>, ___T: Transport,

Source§

async fn read(&mut self, responder: Responder<Read, ___T>)

Source§

async fn set_buffer_mode( &mut self, request: Request<SetBufferMode, ___T>, responder: Responder<SetBufferMode, ___T>, )

Source§

async fn get_interrupt( &mut self, request: Request<GetInterrupt, ___T>, responder: Responder<GetInterrupt, ___T>, )

Source§

async fn configure_interrupt( &mut self, request: Request<ConfigureInterrupt, ___T>, responder: Responder<ConfigureInterrupt, ___T>, )

Source§

async fn release_interrupt( &mut self, responder: Responder<ReleaseInterrupt, ___T>, )

Source§

async fn on_unknown_interaction(&mut self, ordinal: u64)

Implementors§