rustpython_vm::function::OptionalArg - Rust
An argument that may or may not be provided by the caller.
This style of argument is not possible in pure Python.
impl<T> OptionalArg<T>[src]
pub fn is_present(&self) -> bool[src]
Returns true if self is of variant Present.
pub fn expect_present(self) -> T where
Self: Debug, [src]
Self: Debug,
Unwraps the value, yielding the content of Present.
Panics if the value is not Present, with a panic message including the content of self.
pub fn present(self) -> Option<T>[src]
Returns Some if self is of variant Present, and None otherwise.
pub fn is_missing(&self) -> bool[src]
Returns true if self is of variant Missing.
impl<T> OptionalArg<T>
pub fn from_option(option: Option<T>) -> Self
pub fn into_option(self) -> Option<T>
pub fn as_option(&self) -> Option<&T>
pub fn as_option_mut(&mut self) -> Option<&mut T>
pub fn as_ref(&self) -> OptionalArg<&T>
pub fn as_mut(&mut self) -> OptionalArg<&mut T>
pub fn expect(self, msg: &str) -> T
pub fn unwrap(self) -> T
pub fn unwrap_or(self, default: T) -> T
pub fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> OptionalArg<U>
pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U
pub fn map_or_else<U, D: FnOnce() -> U, F: FnOnce(T) -> U>(
self,
default: D,
f: F
) -> U
self,
default: D,
f: F
) -> U
pub fn ok_or<E>(self, err: E) -> Result<T, E>
pub fn ok_or_else<E, F: FnOnce() -> E>(self, err: F) -> Result<T, E>
pub fn and<U>(self, optb: OptionalArg<U>) -> OptionalArg<U>
pub fn and_then<U, F: FnOnce(T) -> OptionalArg<U>>(self, f: F) -> OptionalArg<U>
pub fn filter<P: FnOnce(&T) -> bool>(self, predicate: P) -> Self
pub fn or(self, optb: OptionalArg<T>) -> OptionalArg<T>
pub fn or_else<F: FnOnce() -> OptionalArg<T>>(self, f: F) -> OptionalArg<T>
pub fn xor(self, optb: OptionalArg<T>) -> OptionalArg<T>
pub fn get_or_insert(&mut self, v: T) -> &mut T
pub fn get_or_insert_with<F: FnOnce() -> T>(&mut self, f: F) -> &mut T
pub fn take(&mut self) -> Self
pub fn replace(&mut self, value: T) -> Self
impl<'_, T: Copy> OptionalArg<&'_ T>
pub fn copied(self) -> OptionalArg<T>
impl<'_, T: Copy> OptionalArg<&'_ mut T>
pub fn copied(self) -> OptionalArg<T>
impl<'_, T: Clone> OptionalArg<&'_ T>
pub fn cloned(self) -> OptionalArg<T>
impl<'_, T: Clone> OptionalArg<&'_ mut T>
pub fn cloned(self) -> OptionalArg<T>
impl<T: Default> OptionalArg<T>
pub fn unwrap_or_default(self) -> T
impl<T: Deref> OptionalArg<T>
pub fn as_deref(&self) -> OptionalArg<&T::Target>
impl<T: DerefMut> OptionalArg<T>
pub fn as_deref_mut(&mut self) -> OptionalArg<&mut T::Target>
impl<T, E> OptionalArg<Result<T, E>>
pub fn transpose(self) -> Result<Option<T>, E>
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<!> for T[src]
impl<T> From<T> for T[src]
impl<T> FromArgs for T where
T: TryFromObject, [src]
T: TryFromObject,
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator, [src]
I: Iterator,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Statistics<f64> for T where
T: IntoIterator,
<T as IntoIterator>::Item: Borrow<f64>,
T: IntoIterator,
<T as IntoIterator>::Item: Borrow<f64>,
fn min(self) -> f64
Returns the minimum value in the data Read more
fn max(self) -> f64
Returns the maximum value in the data Read more
fn abs_min(self) -> f64
Returns the minimum absolute value in the data Read more
fn abs_max(self) -> f64
Returns the maximum absolute value in the data Read more
fn mean(self) -> f64
Evaluates the sample mean, an estimate of the population mean. Read more
fn geometric_mean(self) -> f64
Evaluates the geometric mean of the data Read more
fn harmonic_mean(self) -> f64
Evaluates the harmonic mean of the data Read more
fn variance(self) -> f64
Estimates the unbiased population variance from the provided samples Read more
fn std_dev(self) -> f64
Estimates the unbiased population standard deviation from the provided samples Read more
fn population_variance(self) -> f64
Evaluates the population variance from a full population. Read more
fn population_std_dev(self) -> f64
Evaluates the population standard deviation from a full population. Read more
fn covariance(self, other: T) -> f64
Estimates the unbiased population covariance between the two provided samples Read more
fn population_covariance(self, other: T) -> f64
Evaluates the population covariance between the two provider populations Read more
fn quadratic_mean(self) -> f64
Estimates the quadratic mean (Root Mean Square) of the data Read more
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,