Struct LiteralRule
pub struct LiteralRule {
pub host_match: String,
pub host_replacement: String,
pub path_prefix_match: String,
pub path_prefix_replacement: String,
}
Expand description
A literal match and replacement rule.
§Examples
Replaces example.com with test.example.com for all packages
{
host_match: "example.com"
host_replacement: "test.example.com"
path_prefix_match: "/"
path_prefix_replacement: "/"
}
Replaces example.com with test.example.com for fuchsia-pkg://example.com/rolldice. A package called “rolldice” in another repo would not be rewritten.
{
host_match: "example.com"
host_replacement: "test.example.com"
path_prefix_match: "/rolldice"
path_prefix_replacement: "/rolldice"
}
Fields§
§host_match: String
The exact hostname to match.
host_replacement: String
The new hostname to replace the matched host_match
with.
path_prefix_match: String
The absolute path to a package or directory to match against.
If path_prefix_match
ends with ‘/’, it will match any packages or
subdirectories below the matched path.
If path_prefix_match
does not end with ‘/’, it will be interpreted as
as an exact match.
§Examples
“/example” only matches a package called “example” at the root of the repo. “/parent/examples” and “/examples” would not match.
“/example/” would match any package under the “example” path at the root of the repo. For example, “/example/”, “/example/package” would both match.
path_prefix_replacement: String
The absolute path to a single package or a directory to replace the
matched path_prefix_match
with.
path_prefix_match
and path_prefix_replacement
must both match
directories or both match exact packages. Mixing the two forms is not
allowed.
Trait Implementations§
§impl Clone for LiteralRule
impl Clone for LiteralRule
§fn clone(&self) -> LiteralRule
fn clone(&self) -> LiteralRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for LiteralRule
impl Debug for LiteralRule
§impl<D> Decode<LiteralRule, D> for LiteralRulewhere
D: ResourceDialect,
impl<D> Decode<LiteralRule, D> for LiteralRulewhere
D: ResourceDialect,
§fn new_empty() -> LiteralRule
fn new_empty() -> LiteralRule
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl<D> Encode<LiteralRule, D> for &LiteralRulewhere
D: ResourceDialect,
impl<D> Encode<LiteralRule, D> for &LiteralRulewhere
D: ResourceDialect,
§impl Hash for LiteralRule
impl Hash for LiteralRule
§impl Ord for LiteralRule
impl Ord for LiteralRule
§impl PartialEq for LiteralRule
impl PartialEq for LiteralRule
§impl PartialOrd for LiteralRule
impl PartialOrd for LiteralRule
§impl TypeMarker for LiteralRule
impl TypeMarker for LiteralRule
§type Owned = LiteralRule
type Owned = LiteralRule
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.§impl ValueTypeMarker for LiteralRule
impl ValueTypeMarker for LiteralRule
§type Borrowed<'a> = &'a LiteralRule
type Borrowed<'a> = &'a LiteralRule
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<LiteralRule as TypeMarker>::Owned,
) -> <LiteralRule as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<LiteralRule as TypeMarker>::Owned, ) -> <LiteralRule as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.