Struct fidl_test_sagcontrol::StateProxy
source · pub struct StateProxy { /* private fields */ }
Implementations§
source§impl StateProxy
impl StateProxy
sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for test.sagcontrol/State.
sourcepub fn take_event_stream(&self) -> StateEventStream
pub fn take_event_stream(&self) -> StateEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
sourcepub fn set(
&self,
payload: &SystemActivityGovernorState,
) -> QueryResponseFut<StateSetResult, DefaultFuchsiaResourceDialect>
pub fn set( &self, payload: &SystemActivityGovernorState, ) -> QueryResponseFut<StateSetResult, DefaultFuchsiaResourceDialect>
Sets the power elements to specific states supported by SAG.
The initial state of SAG is (2, 0, 0, 0). SAG maintains execution_state_level == 2 until a “boot complete” logic is triggered. “boot complete” logic is triggered by setting SAG states to (2, 1, any, any).
Supported states before “boot complete”:
- (2, any, any, any) Supported states after “boot complete”:
- (2, 1, any, any)
- (1, 0, 1, any)
- (1, 0, any, 1)
- (0, 0, 0, 0)
In SystemActivityGovernorState, omitting specifying a power element’s state will preserve its existing state.
sourcepub fn get(
&self,
) -> QueryResponseFut<SystemActivityGovernorState, DefaultFuchsiaResourceDialect>
pub fn get( &self, ) -> QueryResponseFut<SystemActivityGovernorState, DefaultFuchsiaResourceDialect>
Return immediately with the current state of SAG.
sourcepub fn watch(
&self,
) -> QueryResponseFut<SystemActivityGovernorState, DefaultFuchsiaResourceDialect>
pub fn watch( &self, ) -> QueryResponseFut<SystemActivityGovernorState, DefaultFuchsiaResourceDialect>
On a given connection, the first call will return immediately with SAG’s
current state. Subsequent Watch
requests will only
return if and only if a test.sagcontrol.State.Set
call sends a request and SAG’s
state has changed to the requested supported state.
For example, if the current state of SAG is (1, 0, 1, 0), the first
Watch
will return (1, 0, 1, 0). If a test.sagcontrol.State.Set
call sends a request to change state to (2, 1, 0, 1), the next Watch
will return when the SAG’s state has fully transitioned to (2, 1, 0, 1),
any intermediate transient state (in this example, (2, 0, 1, 0),
(2, 1, 1, 0) and (2, 1, 1, 1)) will not be returned.
Clients should use this to synchronize SAG states.
Trait Implementations§
source§impl Clone for StateProxy
impl Clone for StateProxy
source§fn clone(&self) -> StateProxy
fn clone(&self) -> StateProxy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StateProxy
impl Debug for StateProxy
source§impl Proxy for StateProxy
impl Proxy for StateProxy
§type Protocol = StateMarker
type Protocol = StateMarker
Proxy
controls.source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
source§impl StateProxyInterface for StateProxy
impl StateProxyInterface for StateProxy
type SetResponseFut = QueryResponseFut<Result<(), SetSystemActivityGovernorStateError>>
fn set(&self, payload: &SystemActivityGovernorState) -> Self::SetResponseFut
type GetResponseFut = QueryResponseFut<SystemActivityGovernorState>
fn get(&self) -> Self::GetResponseFut
type WatchResponseFut = QueryResponseFut<SystemActivityGovernorState>
fn watch(&self) -> Self::WatchResponseFut
Auto Trait Implementations§
impl Freeze for StateProxy
impl !RefUnwindSafe for StateProxy
impl Send for StateProxy
impl Sync for StateProxy
impl Unpin for StateProxy
impl !UnwindSafe for StateProxy
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)