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) -> Selfwhere T: Default,

source

pub fn unwrap_or_default(self) -> Twhere 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) -> Twhere Self: Debug,

Unwraps the value, yielding the content of Assign.

Panics

Panics if the value is not Assign, with a panic message including 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 copy of the value. Read more
source§

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

Performs copy-assignment from source. Read more
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>

§

type Item = T

The type of the elements being iterated over.
§

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>

§

type SomeType = T

source§

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

Auto Trait Implementations§

§

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> UnwindSafe for PySetterValue<T>where T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

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

§

fn exact_from(value: T) -> U

§

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

§

fn exact_into(self) -> U

source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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.

§

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

§

fn overflowing_into(self) -> (U, bool)

§

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

§

fn rounding_into(self, rm: RoundingMode) -> U

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

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

§

fn saturating_into(self) -> U

§

impl<T> ToDebugString for Twhere T: Debug,

§

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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

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

§

fn wrapping_into(self) -> U

source§

impl<T> PyThreadingConstraint for T