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§
Sourcefn read(&mut self, responder: Responder<Read, ___T>) -> impl Future<Output = ()>
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.
Sourcefn set_buffer_mode(
&mut self,
request: Request<SetBufferMode, ___T>,
responder: Responder<SetBufferMode, ___T>,
) -> impl Future<Output = ()>
fn set_buffer_mode( &mut self, request: Request<SetBufferMode, ___T>, responder: Responder<SetBufferMode, ___T>, ) -> impl Future<Output = ()>
Configures the output buffer as per mode.
Sourcefn get_interrupt(
&mut self,
request: Request<GetInterrupt, ___T>,
responder: Responder<GetInterrupt, ___T>,
) -> impl Future<Output = ()>
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.
Sourcefn configure_interrupt(
&mut self,
request: Request<ConfigureInterrupt, ___T>,
responder: Responder<ConfigureInterrupt, ___T>,
) -> impl Future<Output = ()>
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.
Sourcefn release_interrupt(
&mut self,
responder: Responder<ReleaseInterrupt, ___T>,
) -> impl Future<Output = ()>
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§
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.