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,
},
}
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: CounterIncrementResponder
ConnectToProtocol
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
path
the absolute path from the root of the server’s namespace. - request
flags
the rights with which to open the node. - request
request
the server end channel to the node.
TryOpenDirectory
Opens the directory found at path
.
- request
path
the absolute path from the server’s namespace.
- error
ZX_ERR_NOT_FOUND
if the directory atpath
is not in the server’s namespace. - error
ZX_ERR_IO
if there is some other unspecified error during I/O.
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)>
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