Skip to main content

PySetterValue

Enum PySetterValue 

Source
pub enum PySetterValue<T = PyObjectRef> {
    Assign(T),
    Delete,
}

Variants§

§

Assign(T)

§

Delete

Implementations§

Source§

impl<T> PySetterValue<T>

Source

pub fn from_option(option: Option<T>) -> Self

Source

pub fn into_option(self) -> Option<T>

Source

pub fn as_option(&self) -> Option<&T>

Source

pub fn as_option_mut(&mut self) -> Option<&mut T>

Source

pub fn expect(self, msg: &str) -> T

Source

pub fn unwrap(self) -> T

Source

pub fn unwrap_or(self, default: T) -> T

Source

pub fn unwrap_or_else<_Function: FnOnce() -> T>(self, f: _Function) -> T

Source

pub fn ok_or<_Error>(self, err: _Error) -> Result<T, _Error>

Source

pub fn ok_or_else<_Error, _Function: FnOnce() -> _Error>( self, err: _Function, ) -> Result<T, _Error>

Source

pub fn filter<P: FnOnce(&T) -> bool>(self, predicate: P) -> Self

Source

pub fn or(self, optb: Self) -> Self

Source

pub fn or_else<_Function: FnOnce() -> Self>(self, f: _Function) -> Self

Source

pub fn map_or<_Other, _Function: FnOnce(T) -> _Other>( self, default: _Other, f: _Function, ) -> _Other

Source

pub fn xor(self, optb: Self) -> Self

Source

pub fn get_or_insert(&mut self, v: T) -> &mut T

Source

pub fn get_or_insert_with<_Function: FnOnce() -> T>( &mut self, f: _Function, ) -> &mut T

Source

pub fn replace(&mut self, value: T) -> Self

Source§

impl<T> PySetterValue<T>

Source

pub fn as_ref(&self) -> PySetterValue<&T>

Source

pub fn as_mut(&mut self) -> PySetterValue<&mut T>

Source

pub fn map<_Other, _Function: FnOnce(T) -> _Other>( self, f: _Function, ) -> PySetterValue<_Other>

Source

pub fn map_or_else<_Other, _Default: FnOnce() -> _Other, _Function: FnOnce(T) -> _Other>( self, default: _Default, f: _Function, ) -> _Other

Source

pub fn iter(&self) -> impl Iterator<Item = &T>

Source

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>

Source

pub fn and<_Other>(self, optb: PySetterValue<_Other>) -> PySetterValue<_Other>

Source

pub fn and_then<_Other, _Function: FnOnce(T) -> PySetterValue<_Other>>( self, f: _Function, ) -> PySetterValue<_Other>

Source

pub fn zip<_Other>( self, other: PySetterValue<_Other>, ) -> PySetterValue<(T, _Other)>

Source

pub fn take(&mut self) -> Self
where T: Default,

Source

pub fn unwrap_or_default(self) -> T
where T: Default,

Source§

impl<T> PySetterValue<&T>
where T: Copy,

Source

pub fn copied(self) -> PySetterValue<T>

Source§

impl<T> PySetterValue<&mut T>
where T: Copy,

Source

pub fn copied(self) -> PySetterValue<T>

Source§

impl<T> PySetterValue<&T>
where T: Clone,

Source

pub fn cloned(self) -> PySetterValue<T>

Source§

impl<T> PySetterValue<&mut T>
where T: Clone,

Source

pub fn cloned(self) -> PySetterValue<T>

Source§

impl<T> PySetterValue<T>
where T: Deref,

Source

pub fn as_deref(&self) -> PySetterValue<&T::Target>

Source§

impl<T: DerefMut> PySetterValue<T>

Source

pub fn as_deref_mut(&mut self) -> PySetterValue<&mut T::Target>

Source§

impl<T, _Error> PySetterValue<Result<T, _Error>>

Source

pub fn transpose(self) -> Result<PySetterValue<T>, _Error>

Source§

impl<T> PySetterValue<T>

Source

pub const fn is_assign(&self) -> bool

Returns true if self is of variant Assign.

Source

pub fn as_assign(&self) -> Option<&T>

Returns Some if self is a reference of variant Assign, and None otherwise.

Source

pub fn as_mut_assign(&mut self) -> Option<&mut T>

Returns Some if self is a mutable reference of variant Assign, and None otherwise.

Source

pub fn expect_assign(self) -> T
where Self: Debug,

Unwraps the value, yielding the content of Assign.

§Panics

Panics if the value is not Assign. In debug builds the panic message includes the content of self.

Source

pub fn assign(self) -> Option<T>

Returns Some if self is of variant Assign, and None otherwise.

Source

pub const fn is_delete(&self) -> bool

Returns true if self is of variant Delete.

Source§

impl PySetterValue

Trait Implementations§

Source§

impl<T> Clone for PySetterValue<T>
where T: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Copy for PySetterValue<T>
where T: Copy,

Source§

impl<T: Debug> Debug for PySetterValue<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Default for PySetterValue<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T> From<Option<T>> for PySetterValue<T>

Source§

fn from(value: Option<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<PySetterValue<T>> for Option<T>

Source§

fn from(value: PySetterValue<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<T> for PySetterValue<T>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl<T> IntoIterator for PySetterValue<T>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> IntoIter<T> ⓘ

Creates an iterator from a value. Read more
Source§

impl<T> OptionLike for PySetterValue<T>

Auto Trait Implementations§

§

impl<T> Freeze for PySetterValue<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for PySetterValue<T>
where T: RefUnwindSafe,

§

impl<T> Send for PySetterValue<T>
where T: Send,

§

impl<T> Sync for PySetterValue<T>
where T: Sync,

§

impl<T> Unpin for PySetterValue<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for PySetterValue<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for PySetterValue<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<I, C> CompactStringExt for C
where I: AsRef<str>, C: IntoIterator<Item = I>,

Source§

fn concat_compact(self) -> CompactString

Concatenates all the items of a collection into a CompactString Read more
Source§

fn join_compact<S>(self, separator: S) -> CompactString
where S: AsRef<str>,

Joins all the items of a collection, placing a separator between them, forming a CompactString Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T, U> ExactFrom<T> for U
where U: TryFrom<T>,

Source§

fn exact_from(value: T) -> U

Source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

Source§

fn exact_into(self) -> U

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Helper for T

Source§

impl<T, U> ImaginaryInto<U> for T
where U: ImaginaryFrom<T>,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

Source§

impl<T> PrimitiveIntRandomBounds for T

Source§

impl<T> PrimitiveSignedRandomBounds for T

Source§

impl<T> PyThreadingConstraint for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

Source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

Source§

impl<T> ToDebugString for T
where T: Debug,

Source§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

§Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

Source§

fn wrapping_into(self) -> U