pub enum AllowedHostsConfig {
All,
SpecificHosts(Vec<AllowedHostConfig>),
}
Expand description
Represents an allowed_outbound_hosts config.
Variants§
All
SpecificHosts(Vec<AllowedHostConfig>)
Implementations§
Source§impl AllowedHostsConfig
impl AllowedHostsConfig
Sourcepub fn parse<S: AsRef<str>>(
hosts: &[S],
resolver: &PreparedResolver,
) -> Result<AllowedHostsConfig>
pub fn parse<S: AsRef<str>>( hosts: &[S], resolver: &PreparedResolver, ) -> Result<AllowedHostsConfig>
Parses the given allowed_outbound_hosts values, resolving any templates with the given resolver.
Sourcepub fn validate<S: AsRef<str>>(hosts: &[S], resolver: &Resolver) -> Result<()>
pub fn validate<S: AsRef<str>>(hosts: &[S], resolver: &Resolver) -> Result<()>
Validates the given allowed_outbound_hosts values with the given resolver.
Sourcepub fn allows(&self, url: &OutboundUrl) -> bool
pub fn allows(&self, url: &OutboundUrl) -> bool
Returns true if the given url is allowed.
Sourcepub fn allows_relative_url(&self, schemes: &[&str]) -> bool
pub fn allows_relative_url(&self, schemes: &[&str]) -> bool
Returns true if relative (“self”) requests to any of the given schemes are allowed.
Trait Implementations§
Source§impl Clone for AllowedHostsConfig
impl Clone for AllowedHostsConfig
Source§fn clone(&self) -> AllowedHostsConfig
fn clone(&self) -> AllowedHostsConfig
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 AllowedHostsConfig
impl Debug for AllowedHostsConfig
Source§impl Default for AllowedHostsConfig
impl Default for AllowedHostsConfig
Source§impl PartialEq for AllowedHostsConfig
impl PartialEq for AllowedHostsConfig
impl Eq for AllowedHostsConfig
impl StructuralPartialEq for AllowedHostsConfig
Auto Trait Implementations§
impl Freeze for AllowedHostsConfig
impl RefUnwindSafe for AllowedHostsConfig
impl Send for AllowedHostsConfig
impl Sync for AllowedHostsConfig
impl Unpin for AllowedHostsConfig
impl UnwindSafe for AllowedHostsConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more