pub enum ImageSourceFilter<U> {
BlockAll,
AllowAll,
Custom(Arc<dyn Fn(&U) -> bool + Send + Sync>),
}
Expand description
Represents a PathFilter
and UriFilter
.
Variants§
BlockAll
Block all requests of this type.
AllowAll
Allow all requests of this type.
Custom(Arc<dyn Fn(&U) -> bool + Send + Sync>)
Custom filter, returns true
to allow a request, false
to block.
Implementations§
source§impl<U> ImageSourceFilter<U>
impl<U> ImageSourceFilter<U>
source§impl ImageSourceFilter<PathBuf>
impl ImageSourceFilter<PathBuf>
sourcepub fn allow_dir(dir: impl AsRef<Path>) -> Self
pub fn allow_dir(dir: impl AsRef<Path>) -> Self
Allow any file inside dir
or sub-directories of dir
.
sourcepub fn allow_current_dir() -> Self
pub fn allow_current_dir() -> Self
Allow any file inside the env::current_dir
or sub-directories.
Note that the current directory can be changed and the filter always uses the
fresh current directory, use allow_dir
to create a filter the always points
to the current directory at the filter creation time.
sourcepub fn allow_exe_dir() -> Self
pub fn allow_exe_dir() -> Self
Allow any file inside the current executable directory or sub-directories.
sourcepub fn allow_res() -> Self
pub fn allow_res() -> Self
Allow any file inside the zng::env::res
directory or sub-directories.
source§impl ImageSourceFilter<Uri>
impl ImageSourceFilter<Uri>
sourcepub fn allow_host(host: impl Into<Txt>) -> Self
pub fn allow_host(host: impl Into<Txt>) -> Self
Allow any file from the host
site.
Trait Implementations§
source§impl<U: 'static> BitAnd for ImageSourceFilter<U>
impl<U: 'static> BitAnd for ImageSourceFilter<U>
source§impl<U: 'static> BitAndAssign for ImageSourceFilter<U>
impl<U: 'static> BitAndAssign for ImageSourceFilter<U>
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresource§impl<U: 'static> BitOr for ImageSourceFilter<U>
impl<U: 'static> BitOr for ImageSourceFilter<U>
source§impl<U: 'static> BitOrAssign for ImageSourceFilter<U>
impl<U: 'static> BitOrAssign for ImageSourceFilter<U>
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moresource§impl<U: Clone> Clone for ImageSourceFilter<U>
impl<U: Clone> Clone for ImageSourceFilter<U>
source§fn clone(&self) -> ImageSourceFilter<U>
fn clone(&self) -> ImageSourceFilter<U>
Returns a copy 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<U> Debug for ImageSourceFilter<U>
impl<U> Debug for ImageSourceFilter<U>
source§impl<U> PartialEq for ImageSourceFilter<U>
impl<U> PartialEq for ImageSourceFilter<U>
Auto Trait Implementations§
impl<U> Freeze for ImageSourceFilter<U>
impl<U> !RefUnwindSafe for ImageSourceFilter<U>
impl<U> Send for ImageSourceFilter<U>
impl<U> Sync for ImageSourceFilter<U>
impl<U> Unpin for ImageSourceFilter<U>
impl<U> !UnwindSafe for ImageSourceFilter<U>
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Access to mut
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
Clone the value.
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
Clone the value into a new boxed
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self
equals other
.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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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