pub enum CounterRequest {
Increment {
responder: CounterIncrementResponder,
},
ConnectToProtocol {
protocol_name: String,
request: Channel,
control_handle: CounterControlHandle,
},
OpenInNamespace {
path: String,
flags: Flags,
request: Channel,
control_handle: CounterControlHandle,
},
TryOpenDirectory {
path: String,
responder: CounterTryOpenDirectoryResponder,
},
SetAbortOnShutdown {
abort: bool,
responder: CounterSetAbortOnShutdownResponder,
},
}Expand description
Sample interface that keeps a stateful integer counter starting at zero.
Variants§
Increment
Increments internal counter by one and returns new counter value.
Fields
§
responder: CounterIncrementResponderConnectToProtocol
Connects request to a protocol in the /svc directory named
protocol_name.
OpenInNamespace
Opens the node found at path in the component’s namespace with
flags, and connects request.
This is essentially a wrapper around [fuchsia.io/Directory.Open],
which always opens in an implementation-defined mode.
- request
paththe absolute path from the root of the server’s namespace. - request
flagsthe rights with which to open the node. - request
requestthe server end channel to the node.
TryOpenDirectory
Opens the directory found at path.
- request
paththe absolute path from the server’s namespace.
- error
ZX_ERR_NOT_FOUNDif the directory atpathis not in the server’s namespace. - error
ZX_ERR_IOif there is some other unspecified error during I/O.
SetAbortOnShutdown
Controls whether this component crashes (via abort) after receiving a shutdown signal.
- request
abortwhether or not to abort on shutdown.
Implementations§
Source§impl CounterRequest
impl CounterRequest
pub fn into_increment(self) -> Option<CounterIncrementResponder>
pub fn into_connect_to_protocol( self, ) -> Option<(String, Channel, CounterControlHandle)>
pub fn into_open_in_namespace( self, ) -> Option<(String, Flags, Channel, CounterControlHandle)>
pub fn into_try_open_directory( self, ) -> Option<(String, CounterTryOpenDirectoryResponder)>
pub fn into_set_abort_on_shutdown( self, ) -> Option<(bool, CounterSetAbortOnShutdownResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CounterRequest
impl !RefUnwindSafe for CounterRequest
impl Send for CounterRequest
impl Sync for CounterRequest
impl Unpin for CounterRequest
impl !UnwindSafe for CounterRequest
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
Mutably borrows from an owned value. Read more