pub struct ArgIntoBool { /* private fields */ }Expand description
A Python bool-like object.
ArgIntoBool implements FromArgs so that a built-in function can accept
any object that can be transformed into a boolean.
By default an object is considered true unless its class defines either a
__bool__() method that returns False or a __len__() method that returns
zero, when called with the object.
Implementations§
Trait Implementations§
Source§impl Debug for ArgIntoBool
impl Debug for ArgIntoBool
Source§impl Default for ArgIntoBool
impl Default for ArgIntoBool
Source§fn default() -> ArgIntoBool
fn default() -> ArgIntoBool
Returns the “default value” for a type. Read more
Source§impl Deref for ArgIntoBool
impl Deref for ArgIntoBool
Source§impl From<ArgIntoBool> for bool
impl From<ArgIntoBool> for bool
Source§fn from(arg: ArgIntoBool) -> Self
fn from(arg: ArgIntoBool) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ArgIntoBool
impl PartialEq for ArgIntoBool
Source§impl TryFromObject for ArgIntoBool
impl TryFromObject for ArgIntoBool
Source§fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self>
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self>
Attempt to convert a Python object to a value of this type.
impl Eq for ArgIntoBool
impl StructuralPartialEq for ArgIntoBool
Auto Trait Implementations§
impl Freeze for ArgIntoBool
impl RefUnwindSafe for ArgIntoBool
impl Send for ArgIntoBool
impl Sync for ArgIntoBool
impl Unpin for ArgIntoBool
impl UnwindSafe for ArgIntoBool
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> FromArgOptional for Twhere
T: TryFromObject,
impl<T> FromArgOptional for Twhere
T: TryFromObject,
Source§impl<T> FromArgs for Twhere
T: TryFromObject,
impl<T> FromArgs for Twhere
T: TryFromObject,
Source§fn arity() -> RangeInclusive<usize>
fn arity() -> RangeInclusive<usize>
The range of positional arguments permitted by the function signature. Read more
Source§fn from_args(
vm: &VirtualMachine,
args: &mut FuncArgs,
) -> Result<T, ArgumentError>
fn from_args( vm: &VirtualMachine, args: &mut FuncArgs, ) -> Result<T, ArgumentError>
Extracts this item from the next argument(s).
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