pub trait ClockLocalServerHandler<___T = Channel>where
___T: Transport,{
// Required methods
fn enable(
&mut self,
responder: Responder<Enable, ___T>,
) -> impl Future<Output = ()>;
fn disable(
&mut self,
responder: Responder<Disable, ___T>,
) -> impl Future<Output = ()>;
fn is_enabled(
&mut self,
responder: Responder<IsEnabled, ___T>,
) -> impl Future<Output = ()>;
fn set_rate(
&mut self,
request: Request<SetRate, ___T>,
responder: Responder<SetRate, ___T>,
) -> impl Future<Output = ()>;
fn query_supported_rate(
&mut self,
request: Request<QuerySupportedRate, ___T>,
responder: Responder<QuerySupportedRate, ___T>,
) -> impl Future<Output = ()>;
fn get_rate(
&mut self,
responder: Responder<GetRate, ___T>,
) -> impl Future<Output = ()>;
fn set_input(
&mut self,
request: Request<SetInput, ___T>,
responder: Responder<SetInput, ___T>,
) -> impl Future<Output = ()>;
fn get_num_inputs(
&mut self,
responder: Responder<GetNumInputs, ___T>,
) -> impl Future<Output = ()>;
fn get_input(
&mut self,
responder: Responder<GetInput, ___T>,
) -> impl Future<Output = ()>;
fn get_properties(
&mut self,
responder: Responder<GetProperties, ___T>,
) -> impl Future<Output = ()>;
// Provided method
fn on_unknown_interaction(
&mut self,
ordinal: u64,
) -> impl Future<Output = ()> { ... }
}Expand description
A server handler for the Clock protocol.
See Clock for more details.
Required Methods§
Sourcefn enable(
&mut self,
responder: Responder<Enable, ___T>,
) -> impl Future<Output = ()>
fn enable( &mut self, responder: Responder<Enable, ___T>, ) -> impl Future<Output = ()>
Enables (ungates) this clock.
Drivers must call enable on all clocks they depend upon.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support Enable.
Returns ZX_ERR_TIMED_OUT if an operation timed out (for instance, a PLL was unable to lock).
Returns ZX_ERR_INTERNAL if the operation failed for any other reason.
Sourcefn disable(
&mut self,
responder: Responder<Disable, ___T>,
) -> impl Future<Output = ()>
fn disable( &mut self, responder: Responder<Disable, ___T>, ) -> impl Future<Output = ()>
Disables (gates) this clock.
Drivers should call this method to indicate to the clock subsystem that
a particular clock signal is no longer necessary.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support Disable
Returns ZX_ERR_INTERNAL if the operation failed for any other reason.
Sourcefn is_enabled(
&mut self,
responder: Responder<IsEnabled, ___T>,
) -> impl Future<Output = ()>
fn is_enabled( &mut self, responder: Responder<IsEnabled, ___T>, ) -> impl Future<Output = ()>
Returns true if a given clock is running.
May query the hardware or return a cached value.
IsEnabled shall not alter the state of the clock tree in any way.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support IsEnabled.
Sourcefn set_rate(
&mut self,
request: Request<SetRate, ___T>,
responder: Responder<SetRate, ___T>,
) -> impl Future<Output = ()>
fn set_rate( &mut self, request: Request<SetRate, ___T>, responder: Responder<SetRate, ___T>, ) -> impl Future<Output = ()>
Attempt to set the rate of the clock provider.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support SetRate
Returns ZX_ERR_INVALID_ARGS if the requested rate is not one that is reported as supported by QuerySupportedRate.
Returns ZX_ERR_TIMED_OUT if an operation timed out (for instance, a PLL was unable to lock).
Returns ZX_ERR_INTERNAL if the operation failed for any other reason.
Sourcefn query_supported_rate(
&mut self,
request: Request<QuerySupportedRate, ___T>,
responder: Responder<QuerySupportedRate, ___T>,
) -> impl Future<Output = ()>
fn query_supported_rate( &mut self, request: Request<QuerySupportedRate, ___T>, responder: Responder<QuerySupportedRate, ___T>, ) -> impl Future<Output = ()>
Query the hardware for the highest supported rate that does not
exceed hz_in.
QuerySupportedRate shall not alter the state of the clock tree in any way.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support QuerySupportedRate.
Returns ZX_ERR_OUT_OF_RANGE if a suitable rate could not be found.
Sourcefn get_rate(
&mut self,
responder: Responder<GetRate, ___T>,
) -> impl Future<Output = ()>
fn get_rate( &mut self, responder: Responder<GetRate, ___T>, ) -> impl Future<Output = ()>
Returns the current rate that a given clock is running at.
GetRate shall not alter the state of the clock tree in any way.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support GetRate .
Sourcefn set_input(
&mut self,
request: Request<SetInput, ___T>,
responder: Responder<SetInput, ___T>,
) -> impl Future<Output = ()>
fn set_input( &mut self, request: Request<SetInput, ___T>, responder: Responder<SetInput, ___T>, ) -> impl Future<Output = ()>
Sets the input of this clock by index. I.e. by selecting a mux.
This clock has N inputs defined 0 through N-1, which are valid arguemts
as the index to SetInput.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support SetInput
Returns ZX_ERR_OUT_OF_RANGE if idx is outside of the range supplied by GetNumInputs.
Returns ZX_ERR_INTERNAL if the operation failed for any other reason.
Sourcefn get_num_inputs(
&mut self,
responder: Responder<GetNumInputs, ___T>,
) -> impl Future<Output = ()>
fn get_num_inputs( &mut self, responder: Responder<GetNumInputs, ___T>, ) -> impl Future<Output = ()>
Returns the number of inputs this clock has.
Any value between 0 and UINT32_MAX is a valid return for this method.
A Root Oscillator may return 0 for instance, if it has no inputs.
GetNumInputs shall not alter the state of the clock tree in any way.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support GetNumInputs.
Sourcefn get_input(
&mut self,
responder: Responder<GetInput, ___T>,
) -> impl Future<Output = ()>
fn get_input( &mut self, responder: Responder<GetInput, ___T>, ) -> impl Future<Output = ()>
Returns the index of the current input of this clock.
GetInput shall not alter the state of the clock tree in any way.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support GetInput.
Sourcefn get_properties(
&mut self,
responder: Responder<GetProperties, ___T>,
) -> impl Future<Output = ()>
fn get_properties( &mut self, responder: Responder<GetProperties, ___T>, ) -> impl Future<Output = ()>
Returns the static properties of a clock.
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.