pub trait DefaultFilterable {
type Filtered<'a>
where Self: 'a;
type Error: Into<Error>;
// Required method
fn as_filtered(&self) -> Result<Option<Self::Filtered<'_>>, Self::Error>;
}Expand description
A type (or a reference to it) that can be used in |assigned_or.
The type is either a monad such as Option or Result, or a type that has a well defined,
trivial default value, e.g. an empty str or 0 for integer types.
Required Associated Types§
Sourcetype Error: Into<Error>
type Error: Into<Error>
An error that prevented as_filtered() to succeed,
e.g. a poisoned state or an unacquirable lock.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl DefaultFilterable for bool
A bool has a value if it is true.
impl DefaultFilterable for bool
A bool has a value if it is true.
type Filtered<'a> = bool
type Error = Infallible
fn as_filtered(&self) -> Result<Option<bool>, Infallible>
Source§impl DefaultFilterable for f32
impl DefaultFilterable for f32
Source§impl DefaultFilterable for f64
impl DefaultFilterable for f64
Source§impl DefaultFilterable for i8
A i8 has a value if it is not 0.
impl DefaultFilterable for i8
A i8 has a value if it is not 0.
type Filtered<'a> = i8
type Error = Infallible
fn as_filtered(&self) -> Result<Option<i8>, Infallible>
Source§impl DefaultFilterable for i16
A i16 has a value if it is not 0.
impl DefaultFilterable for i16
A i16 has a value if it is not 0.
type Filtered<'a> = i16
type Error = Infallible
fn as_filtered(&self) -> Result<Option<i16>, Infallible>
Source§impl DefaultFilterable for i32
A i32 has a value if it is not 0.
impl DefaultFilterable for i32
A i32 has a value if it is not 0.
type Filtered<'a> = i32
type Error = Infallible
fn as_filtered(&self) -> Result<Option<i32>, Infallible>
Source§impl DefaultFilterable for i64
A i64 has a value if it is not 0.
impl DefaultFilterable for i64
A i64 has a value if it is not 0.
type Filtered<'a> = i64
type Error = Infallible
fn as_filtered(&self) -> Result<Option<i64>, Infallible>
Source§impl DefaultFilterable for i128
A i128 has a value if it is not 0.
impl DefaultFilterable for i128
A i128 has a value if it is not 0.
type Filtered<'a> = i128
type Error = Infallible
fn as_filtered(&self) -> Result<Option<i128>, Infallible>
Source§impl DefaultFilterable for isize
A isize has a value if it is not 0.
impl DefaultFilterable for isize
A isize has a value if it is not 0.
type Filtered<'a> = isize
type Error = Infallible
fn as_filtered(&self) -> Result<Option<isize>, Infallible>
Source§impl DefaultFilterable for str
A str has a value if it is not empty.
impl DefaultFilterable for str
A str has a value if it is not empty.
type Filtered<'a> = &'a str where Self: 'a
type Error = Infallible
fn as_filtered(&self) -> Result<Option<&str>, Infallible>
Source§impl DefaultFilterable for u8
A u8 has a value if it is not 0.
impl DefaultFilterable for u8
A u8 has a value if it is not 0.
type Filtered<'a> = u8
type Error = Infallible
fn as_filtered(&self) -> Result<Option<u8>, Infallible>
Source§impl DefaultFilterable for u16
A u16 has a value if it is not 0.
impl DefaultFilterable for u16
A u16 has a value if it is not 0.
type Filtered<'a> = u16
type Error = Infallible
fn as_filtered(&self) -> Result<Option<u16>, Infallible>
Source§impl DefaultFilterable for u32
A u32 has a value if it is not 0.
impl DefaultFilterable for u32
A u32 has a value if it is not 0.
type Filtered<'a> = u32
type Error = Infallible
fn as_filtered(&self) -> Result<Option<u32>, Infallible>
Source§impl DefaultFilterable for u64
A u64 has a value if it is not 0.
impl DefaultFilterable for u64
A u64 has a value if it is not 0.
type Filtered<'a> = u64
type Error = Infallible
fn as_filtered(&self) -> Result<Option<u64>, Infallible>
Source§impl DefaultFilterable for u128
A u128 has a value if it is not 0.
impl DefaultFilterable for u128
A u128 has a value if it is not 0.
type Filtered<'a> = u128
type Error = Infallible
fn as_filtered(&self) -> Result<Option<u128>, Infallible>
Source§impl DefaultFilterable for usize
A usize has a value if it is not 0.
impl DefaultFilterable for usize
A usize has a value if it is not 0.
type Filtered<'a> = usize
type Error = Infallible
fn as_filtered(&self) -> Result<Option<usize>, Infallible>
Source§impl DefaultFilterable for String
A String has a value if it is not empty.
impl DefaultFilterable for String
A String has a value if it is not empty.
type Filtered<'a> = &'a str where Self: 'a
type Error = Infallible
fn as_filtered(&self) -> Result<Option<&str>, Infallible>
Source§impl DefaultFilterable for NonZeroI8
A NonZeroI8 always has a value.
impl DefaultFilterable for NonZeroI8
A NonZeroI8 always has a value.
type Filtered<'a> = i8
type Error = Infallible
fn as_filtered(&self) -> Result<Option<i8>, Infallible>
Source§impl DefaultFilterable for NonZeroI16
A NonZeroI16 always has a value.
impl DefaultFilterable for NonZeroI16
A NonZeroI16 always has a value.
type Filtered<'a> = i16
type Error = Infallible
fn as_filtered(&self) -> Result<Option<i16>, Infallible>
Source§impl DefaultFilterable for NonZeroI32
A NonZeroI32 always has a value.
impl DefaultFilterable for NonZeroI32
A NonZeroI32 always has a value.
type Filtered<'a> = i32
type Error = Infallible
fn as_filtered(&self) -> Result<Option<i32>, Infallible>
Source§impl DefaultFilterable for NonZeroI64
A NonZeroI64 always has a value.
impl DefaultFilterable for NonZeroI64
A NonZeroI64 always has a value.
type Filtered<'a> = i64
type Error = Infallible
fn as_filtered(&self) -> Result<Option<i64>, Infallible>
Source§impl DefaultFilterable for NonZeroI128
A NonZeroI128 always has a value.
impl DefaultFilterable for NonZeroI128
A NonZeroI128 always has a value.
type Filtered<'a> = i128
type Error = Infallible
fn as_filtered(&self) -> Result<Option<i128>, Infallible>
Source§impl DefaultFilterable for NonZeroIsize
A NonZeroIsize always has a value.
impl DefaultFilterable for NonZeroIsize
A NonZeroIsize always has a value.
type Filtered<'a> = isize
type Error = Infallible
fn as_filtered(&self) -> Result<Option<isize>, Infallible>
Source§impl DefaultFilterable for NonZeroU8
A NonZeroU8 always has a value.
impl DefaultFilterable for NonZeroU8
A NonZeroU8 always has a value.
type Filtered<'a> = u8
type Error = Infallible
fn as_filtered(&self) -> Result<Option<u8>, Infallible>
Source§impl DefaultFilterable for NonZeroU16
A NonZeroU16 always has a value.
impl DefaultFilterable for NonZeroU16
A NonZeroU16 always has a value.
type Filtered<'a> = u16
type Error = Infallible
fn as_filtered(&self) -> Result<Option<u16>, Infallible>
Source§impl DefaultFilterable for NonZeroU32
A NonZeroU32 always has a value.
impl DefaultFilterable for NonZeroU32
A NonZeroU32 always has a value.
type Filtered<'a> = u32
type Error = Infallible
fn as_filtered(&self) -> Result<Option<u32>, Infallible>
Source§impl DefaultFilterable for NonZeroU64
A NonZeroU64 always has a value.
impl DefaultFilterable for NonZeroU64
A NonZeroU64 always has a value.
type Filtered<'a> = u64
type Error = Infallible
fn as_filtered(&self) -> Result<Option<u64>, Infallible>
Source§impl DefaultFilterable for NonZeroU128
A NonZeroU128 always has a value.
impl DefaultFilterable for NonZeroU128
A NonZeroU128 always has a value.
type Filtered<'a> = u128
type Error = Infallible
fn as_filtered(&self) -> Result<Option<u128>, Infallible>
Source§impl DefaultFilterable for NonZeroUsize
A NonZeroUsize always has a value.
impl DefaultFilterable for NonZeroUsize
A NonZeroUsize always has a value.
type Filtered<'a> = usize
type Error = Infallible
fn as_filtered(&self) -> Result<Option<usize>, Infallible>
Source§impl<T> DefaultFilterable for Option<T>
An Option has a value if it is Some.
impl<T> DefaultFilterable for Option<T>
An Option has a value if it is Some.
type Filtered<'a> = &'a T where Self: 'a
type Error = Infallible
fn as_filtered(&self) -> Result<Option<&T>, Infallible>
Source§impl<T> DefaultFilterable for Pin<T>
A pinned reference has a value if the referenced data has a value.
impl<T> DefaultFilterable for Pin<T>
A pinned reference has a value if the referenced data has a value.
Source§impl<T: DefaultFilterable + ToOwned + ?Sized> DefaultFilterable for Cow<'_, T>
A Cow has a value if it’s borrowed data has a value.
impl<T: DefaultFilterable + ToOwned + ?Sized> DefaultFilterable for Cow<'_, T>
A Cow has a value if it’s borrowed data has a value.
Source§impl<T: DefaultFilterable + ?Sized> DefaultFilterable for &T
impl<T: DefaultFilterable + ?Sized> DefaultFilterable for &T
Source§impl<T: DefaultFilterable + ?Sized> DefaultFilterable for &mut T
impl<T: DefaultFilterable + ?Sized> DefaultFilterable for &mut T
Source§impl<T: DefaultFilterable + ?Sized> DefaultFilterable for Box<T>
impl<T: DefaultFilterable + ?Sized> DefaultFilterable for Box<T>
Source§impl<T: DefaultFilterable + ?Sized> DefaultFilterable for Rc<T>
impl<T: DefaultFilterable + ?Sized> DefaultFilterable for Rc<T>
Source§impl<T: DefaultFilterable + ?Sized> DefaultFilterable for Arc<T>
impl<T: DefaultFilterable + ?Sized> DefaultFilterable for Arc<T>
Source§impl<T: DefaultFilterable + ?Sized> DefaultFilterable for Ref<'_, T>
impl<T: DefaultFilterable + ?Sized> DefaultFilterable for Ref<'_, T>
Source§impl<T: DefaultFilterable + ?Sized> DefaultFilterable for RefMut<'_, T>
impl<T: DefaultFilterable + ?Sized> DefaultFilterable for RefMut<'_, T>
Source§impl<T: DefaultFilterable + ?Sized> DefaultFilterable for MutexGuard<'_, T>
impl<T: DefaultFilterable + ?Sized> DefaultFilterable for MutexGuard<'_, T>
Source§impl<T: DefaultFilterable + ?Sized> DefaultFilterable for RwLockReadGuard<'_, T>
impl<T: DefaultFilterable + ?Sized> DefaultFilterable for RwLockReadGuard<'_, T>
Source§impl<T: DefaultFilterable + ?Sized> DefaultFilterable for RwLockWriteGuard<'_, T>
impl<T: DefaultFilterable + ?Sized> DefaultFilterable for RwLockWriteGuard<'_, T>
Source§impl<T: DefaultFilterable> DefaultFilterable for Saturating<T>
A Saturating integer has a value if it is not 0.
impl<T: DefaultFilterable> DefaultFilterable for Saturating<T>
A Saturating integer has a value if it is not 0.
Source§impl<T: DefaultFilterable> DefaultFilterable for Wrapping<T>
A Wrapping integer has a value if it is not 0.
impl<T: DefaultFilterable> DefaultFilterable for Wrapping<T>
A Wrapping integer has a value if it is not 0.