pub struct HostPattern(/* private fields */);Expand description
A validated host pattern from [[network.additional_hosts]].
Construction goes through HostPattern::new (or the
TryFrom<&str> / TryFrom<String> impls), which run
validate_pattern internally. The serde Deserialize impl
also goes through TryFrom<String>, so any path that produces a
HostPattern value — including TOML deserialisation — has
passed validation. The invariant “this is a syntactically valid
ADR-0028 D2-1 pattern” is therefore type-level.
Implementations§
Source§impl HostPattern
impl HostPattern
Sourcepub fn new(raw: impl Into<String>) -> Result<Self, PatternError>
pub fn new(raw: impl Into<String>) -> Result<Self, PatternError>
Construct after validation. Most callers prefer the
TryFrom impls.
§Errors
Returns PatternError for any input that fails
validate_pattern.
Trait Implementations§
Source§impl Clone for HostPattern
impl Clone for HostPattern
Source§fn clone(&self) -> HostPattern
fn clone(&self) -> HostPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HostPattern
impl Debug for HostPattern
Source§impl<'de> Deserialize<'de> for HostPattern
impl<'de> Deserialize<'de> for HostPattern
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for HostPattern
impl Hash for HostPattern
Source§impl PartialEq for HostPattern
impl PartialEq for HostPattern
Source§impl TryFrom<&str> for HostPattern
impl TryFrom<&str> for HostPattern
Source§impl TryFrom<String> for HostPattern
impl TryFrom<String> for HostPattern
impl Eq for HostPattern
impl StructuralPartialEq for HostPattern
Auto Trait Implementations§
impl Freeze for HostPattern
impl RefUnwindSafe for HostPattern
impl Send for HostPattern
impl Sync for HostPattern
impl Unpin for HostPattern
impl UnsafeUnpin for HostPattern
impl UnwindSafe for HostPattern
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more