pub enum NamespaceControllerRequest {
Detach {
responder: NamespaceControllerDetachResponder,
},
PushChanges {
changes: Vec<Change>,
responder: NamespaceControllerPushChangesResponder,
},
Commit {
payload: CommitOptions,
responder: NamespaceControllerCommitResponder,
},
}
Expand description
Provides mutable access to an isolated view of packet filtering configuration.
The handle to this protocol encodes the lifetime of the contained state.
Closing the client end will remove filtering state owned by this controller,
unless the client has previously called Detach
.
Note that pending changes, on the other hand, will always be flushed when the client end of this protocol is closed (even if the client has detached).
Variants§
Detach
Detaches the client end from the controller’s lifetime.
After calling Detach
, closing this client end no longer causes the
filtering state owned by the controller to be removed. The key returned
by the method can be used once by a client to reconnect to a detached
controller. This allows clients to ensure the filtering state they
install is resilient to client-side crashes and disconnections. (Note,
however, that closing the client end of the channel will flush any
pending changes that have been pushed but not yet committed.)
Detach
can be called multiple times; the key returned by the most
recent call is valid to reconnect to the controller. Calling Detach
will always return a new key and invalidate any previous keys.
Note that, once a client has called Detach
on a controller, the
controller remains detached even after a reconnection. This means that,
for example, if a client detached, closed the client end, reconnected,
and then closed the client end again, the filtering state owned by the
controller would not be removed. After reconnection, the only reason a
client would call Detach
is to be able to reconnect again in the
future, given the key is invalidated after use.
Fields
responder: NamespaceControllerDetachResponder
PushChanges
Append a set of changes to a pending transactional update to the filtering configuration.
To apply these changes, a client must call Commit
.
Commit
Apply all pending changes. The set of changes will either be applied in its entirety or, in case of an error, not applied at all.
Implementations§
Source§impl NamespaceControllerRequest
impl NamespaceControllerRequest
pub fn into_detach(self) -> Option<NamespaceControllerDetachResponder>
pub fn into_push_changes( self, ) -> Option<(Vec<Change>, NamespaceControllerPushChangesResponder)>
pub fn into_commit( self, ) -> Option<(CommitOptions, NamespaceControllerCommitResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL