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§
Source§impl Clone for LiteralRule
impl Clone for LiteralRule
Source§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 moreSource§impl Debug for LiteralRule
impl Debug for LiteralRule
Source§impl<D: ResourceDialect> Decode<LiteralRule, D> for LiteralRule
impl<D: ResourceDialect> Decode<LiteralRule, D> for LiteralRule
Source§impl<D: ResourceDialect> Encode<LiteralRule, D> for &LiteralRule
impl<D: ResourceDialect> Encode<LiteralRule, D> for &LiteralRule
Source§impl<D: ResourceDialect, T0: Encode<UnboundedString, D>, T1: Encode<UnboundedString, D>, T2: Encode<UnboundedString, D>, T3: Encode<UnboundedString, D>> Encode<LiteralRule, D> for (T0, T1, T2, T3)
impl<D: ResourceDialect, T0: Encode<UnboundedString, D>, T1: Encode<UnboundedString, D>, T2: Encode<UnboundedString, D>, T3: Encode<UnboundedString, D>> Encode<LiteralRule, D> for (T0, T1, T2, T3)
Source§impl Hash for LiteralRule
impl Hash for LiteralRule
Source§impl Ord for LiteralRule
impl Ord for LiteralRule
Source§fn cmp(&self, other: &LiteralRule) -> Ordering
fn cmp(&self, other: &LiteralRule) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for LiteralRule
impl PartialEq for LiteralRule
Source§impl PartialOrd for LiteralRule
impl PartialOrd for LiteralRule
Source§impl TypeMarker for LiteralRule
impl TypeMarker for LiteralRule
Source§type Owned = LiteralRule
type Owned = LiteralRule
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§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.Source§impl ValueTypeMarker for LiteralRule
impl ValueTypeMarker for LiteralRule
Source§type Borrowed<'a> = &'a LiteralRule
type Borrowed<'a> = &'a LiteralRule
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more