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
Source§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>>
type GetResponseFut = QueryResponseFut<SystemActivityGovernorState>
type WatchResponseFut = QueryResponseFut<SystemActivityGovernorState>
fn set(&self, payload: &SystemActivityGovernorState) -> Self::SetResponseFut
fn get(&self) -> Self::GetResponseFut
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)