pub enum EngineRequest {
StartEditTransaction {
transaction: ServerEnd<EditTransactionMarker>,
control_handle: EngineControlHandle,
},
List {
iterator: ServerEnd<RuleIteratorMarker>,
control_handle: EngineControlHandle,
},
ListStatic {
iterator: ServerEnd<RuleIteratorMarker>,
control_handle: EngineControlHandle,
},
TestApply {
url: String,
responder: EngineTestApplyResponder,
},
}
Expand description
This manages fuchsia-pkg:// rewrite rules.
When a package resolver is asked to resolve a fuchsia-pkg URL, it must first
iterate through its sequence of rewrite rules (given by [List
]). The
rewrite engine will rewrite the given URL with the first rule that:
- matches the given URL
- produces a valid URL when applied to the given URL
If no rules match, the URL is resolved as-is.
This is intended to be implemented by package resolver components, and used by repository administration tools.
Variants§
StartEditTransaction
Begins a rule edit transaction.
- request
transaction
a request for an [EditTransaction
].
List
Returns an iterator over all rewrite rules.
- request
iterator
a request for an iterator.
ListStatic
Returns an iterator over all static (immutable) rewrite rules. These
rules are handled as lower priority than dynamic rules and cannot be
modified (although they can be overridden) by [EditTransaction
]s.
- request
iterator
a request for an iterator.
TestApply
Rewrites the given url
with the current rewrite rule set, returning the
rewritten
url. If no rules match or a rule matches but performs an
identity transformation, this API returns url
unchanged.
This API is intended only for reflecting on rule side effects. Using
this API to pre-apply the rules, then passing the result to
[fuchsia.pkg/PackageResolver.Resolve
] would apply the rules twice.
- request
url
the url to rewrite.
- response
rewritten
the rewritten url.
- error a zx_status value indicating failure. One of the following:
ZX_ERR_INVALID_ARGS
ifurl
is not a validfuchsia-pkg://
URL. Seefuchsia-pkg URL
.
Implementations§
Source§impl EngineRequest
impl EngineRequest
pub fn into_start_edit_transaction( self, ) -> Option<(ServerEnd<EditTransactionMarker>, EngineControlHandle)>
pub fn into_list( self, ) -> Option<(ServerEnd<RuleIteratorMarker>, EngineControlHandle)>
pub fn into_list_static( self, ) -> Option<(ServerEnd<RuleIteratorMarker>, EngineControlHandle)>
pub fn into_test_apply(self) -> Option<(String, EngineTestApplyResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL