pub enum ControllerRequest {
UpdateAnnotations {
annotations_to_set: Vec<Annotation>,
annotations_to_delete: Vec<AnnotationKey>,
responder: ControllerUpdateAnnotationsResponder,
},
GetAnnotations {
responder: ControllerGetAnnotationsResponder,
},
WatchAnnotations {
responder: ControllerWatchAnnotationsResponder,
},
}
Expand description
An interface that gives clients of Manager
(element proposers) control
over the proposed element’s lifecycle and annotations.
§Lifecycle
The client must keep Controller
connected to ensure the element
remains in the session and is not destroyed. Once Controller
is closed,
the element and its component will be terminated. The element may also terminate
itself, which will cause Controller
to close.
Variants§
UpdateAnnotations
Adds, updates, and removes annotations.
The server is expected to adhere to the following conventions:
- If a key in
annotations_to_set
is new, a new annotation is added - If a key in
annotations_to_set
already exists, the annotation value is updated - If a key in
annotations_to_delete
does not exist, it is ignored
The same key cannot appear twice in a call to UpdateAnnotations(). In other words, to set two Annotations with matching keys is illegal, as is an attempt to set an Annotation and also delete it.
If the operation results in an error, the annotations remain unchanged, and will not be partially updated.
- error
UpdateAnnotationsError.INVALID_ARGS
if the same key exists in bothannotations_to_set
andannotations_to_delete
. - error
UpdateAnnotationsError.INVALID_ARGS
if a key inannotations_to_set
orannotations_to_delete
has an empty namespace. - error
UpdateAnnotationsError.INVALID_ARGS
if anAnnotationValue.buffer
inannotations_to_set
could not be read. - error
UpdateAnnotationsError.TOO_MANY_ANNOTATIONS
if the operation results in more thanMAX_ANNOTATIONS_PER_ELEMENT
annotations existing.
Fields
annotations_to_set: Vec<Annotation>
annotations_to_delete: Vec<AnnotationKey>
responder: ControllerUpdateAnnotationsResponder
GetAnnotations
Returns the current Annotations
for the element.
- error
GetAnnotationsError
if the annotations could not be returned.
Fields
responder: ControllerGetAnnotationsResponder
WatchAnnotations
Returns the full set of Annotations
when one or more of them have changed, or
when this method is called by the client for the first time.
This operation does not block other requests from the client, but only one
WatchAnnotations
request at a time can be made on a connection. If the
client makes a second WatchAnnotations
request before waiting for the
previous request to complete, the connection will be closed.
- error
WatchAnnotationsError
if the annotations could not be returned.
Fields
responder: ControllerWatchAnnotationsResponder
Implementations§
Source§impl ControllerRequest
impl ControllerRequest
pub fn into_update_annotations( self, ) -> Option<(Vec<Annotation>, Vec<AnnotationKey>, ControllerUpdateAnnotationsResponder)>
pub fn into_get_annotations(self) -> Option<ControllerGetAnnotationsResponder>
pub fn into_watch_annotations( self, ) -> Option<ControllerWatchAnnotationsResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL