pub struct ControlProxy { /* private fields */ }Implementations§
Source§impl ControlProxy
impl ControlProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.net.interfaces.admin/Control.
Sourcepub fn take_event_stream(&self) -> ControlEventStream
pub fn take_event_stream(&self) -> ControlEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn add_address(
&self,
address: &Subnet,
parameters: &AddressParameters,
address_state_provider: ServerEnd<AddressStateProviderMarker>,
) -> Result<(), Error>
pub fn add_address( &self, address: &Subnet, parameters: &AddressParameters, address_state_provider: ServerEnd<AddressStateProviderMarker>, ) -> Result<(), Error>
Assigns an address to the interface.
Errors are communicated via
[fuchsia.net.interfaces.admin/AddressStateProvider.OnAddressRemoved].
- request
addressthe address to assign to the interface. - request
parametersadditional address-specific options. - request
address_state_providerprovides address assignment state and enables updating address properties.
Sourcepub fn remove_address(
&self,
address: &Subnet,
) -> QueryResponseFut<ControlRemoveAddressResult, DefaultFuchsiaResourceDialect>
pub fn remove_address( &self, address: &Subnet, ) -> QueryResponseFut<ControlRemoveAddressResult, DefaultFuchsiaResourceDialect>
Removes an address from the interface.
- request
addressthe address to remove.
- response
did_removetrueiffaddresswas removed from the interface as a consequence of this call.
Sourcepub fn get_id(&self) -> QueryResponseFut<u64, DefaultFuchsiaResourceDialect>
pub fn get_id(&self) -> QueryResponseFut<u64, DefaultFuchsiaResourceDialect>
Gets the interface identifier.
- response
idthe interface identifier.
Sourcepub fn set_configuration(
&self,
config: &Configuration,
) -> QueryResponseFut<ControlSetConfigurationResult, DefaultFuchsiaResourceDialect>
pub fn set_configuration( &self, config: &Configuration, ) -> QueryResponseFut<ControlSetConfigurationResult, DefaultFuchsiaResourceDialect>
Sets the configuration for the interface.
Only set fields that are supported in the provided Configuration
will be set; unset fields will be left unmodified. The server will
return a Configuration which holds the previous configuration for
fields that the interface supports and set, even if the call did not
update the configuration’s value.
- request
configthe configuration fields to update on the interface.
- response
previous_configa snapshot of the interface’s previous configuration. Only supported fields present inconfigwill be set.
Sourcepub fn get_configuration(
&self,
) -> QueryResponseFut<ControlGetConfigurationResult, DefaultFuchsiaResourceDialect>
pub fn get_configuration( &self, ) -> QueryResponseFut<ControlGetConfigurationResult, DefaultFuchsiaResourceDialect>
Gets a snapshot of the interface’s configuration.
The server will populate the returned Configuration with the
configuration for features/protocols that the interface supports. That
is, fields for unsupported configurations will be unset in the returned
Configuration.
- response
configa snapshot of the interface’s configuration.
Sourcepub fn enable(
&self,
) -> QueryResponseFut<ControlEnableResult, DefaultFuchsiaResourceDialect>
pub fn enable( &self, ) -> QueryResponseFut<ControlEnableResult, DefaultFuchsiaResourceDialect>
Enables the interface.
- response
did_enabletrueiff the interface moved from disabled to enabled as a consequence of this call.
Sourcepub fn disable(
&self,
) -> QueryResponseFut<ControlDisableResult, DefaultFuchsiaResourceDialect>
pub fn disable( &self, ) -> QueryResponseFut<ControlDisableResult, DefaultFuchsiaResourceDialect>
Disables the interface.
- response
did_disabletrueiff the interface moved from enabled to disabled as a consequence of this call.
Sourcepub fn detach(&self) -> Result<(), Error>
pub fn detach(&self) -> Result<(), Error>
Detaches the client end from the interface’s lifetime.
After calling Detach, closing this client end no longer causes the
interface to be removed.
Get an authentication credential for this interface.
The credential contains a [zx::handle::EVENT], whose entangled
partner is held by the server. This credential can be converted into a
[fuchsia.net.resources/ProofOfInterfaceAuthorization] and then passed
into fuchsia.net.* API calls to prove ownership of this interface. The
EVENT is stable throughout the lifetime of the interface. Clients may
duplicate this EVENT to make multiple API calls, or transfer the
EVENT to other clients.
- response
credentialthe authorization credential for this interface.
Sourcepub fn remove(
&self,
) -> QueryResponseFut<ControlRemoveResult, DefaultFuchsiaResourceDialect>
pub fn remove( &self, ) -> QueryResponseFut<ControlRemoveResult, DefaultFuchsiaResourceDialect>
Initiates interface removal.
This method returns success once interface removal has started. When the
interface is removed, a USER removed reason is issued in
[OnInterfaceRemoved] and the server end is closed.
Trait Implementations§
Source§impl Clone for ControlProxy
impl Clone for ControlProxy
Source§fn clone(&self) -> ControlProxy
fn clone(&self) -> ControlProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ControlProxyInterface for ControlProxy
impl ControlProxyInterface for ControlProxy
type RemoveAddressResponseFut = QueryResponseFut<Result<bool, ControlRemoveAddressError>>
type GetIdResponseFut = QueryResponseFut<u64>
type SetConfigurationResponseFut = QueryResponseFut<Result<Configuration, ControlSetConfigurationError>>
type GetConfigurationResponseFut = QueryResponseFut<Result<Configuration, ControlGetConfigurationError>>
type EnableResponseFut = QueryResponseFut<Result<bool, ControlEnableError>>
type DisableResponseFut = QueryResponseFut<Result<bool, ControlDisableError>>
type GetAuthorizationForInterfaceResponseFut = QueryResponseFut<GrantForInterfaceAuthorization>
type RemoveResponseFut = QueryResponseFut<Result<(), ControlRemoveError>>
fn add_address( &self, address: &Subnet, parameters: &AddressParameters, address_state_provider: ServerEnd<AddressStateProviderMarker>, ) -> Result<(), Error>
fn remove_address(&self, address: &Subnet) -> Self::RemoveAddressResponseFut
fn get_id(&self) -> Self::GetIdResponseFut
fn set_configuration( &self, config: &Configuration, ) -> Self::SetConfigurationResponseFut
fn get_configuration(&self) -> Self::GetConfigurationResponseFut
fn enable(&self) -> Self::EnableResponseFut
fn disable(&self) -> Self::DisableResponseFut
fn detach(&self) -> Result<(), Error>
fn remove(&self) -> Self::RemoveResponseFut
Source§impl Debug for ControlProxy
impl Debug for ControlProxy
Source§impl Proxy for ControlProxy
impl Proxy for ControlProxy
Source§type Protocol = ControlMarker
type Protocol = ControlMarker
Proxy controls.