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 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<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 T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Clone the value.
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
Swap value with
other if both are of the same type.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,
§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