Enum calcu_rs::atom::Func

source ·
pub enum Func {
Show 13 variants Sin(Expr), ArcSin(Expr), Cos(Expr), ArcCos(Expr), Tan(Expr), ArcTan(Expr), Sec(Expr), ArcSec(Expr), Cot(Expr), ArcCot(Expr), Csc(Expr), ArcCsc(Expr), Log(Real, Expr),
}

Variants§

§

Sin(Expr)

§

ArcSin(Expr)

§

Cos(Expr)

§

ArcCos(Expr)

§

Tan(Expr)

§

ArcTan(Expr)

§

Sec(Expr)

§

ArcSec(Expr)

§

Cot(Expr)

§

ArcCot(Expr)

§

Csc(Expr)

§

ArcCsc(Expr)

§

Log(Real, Expr)

Implementations§

source§

impl Func

source

pub fn unwrap_sin(self) -> Expr

Unwraps this value to the Func::Sin variant. Panics if this value is of any other type.

source

pub fn unwrap_sin_ref(&self) -> &Expr

Unwraps this reference to the Func::Sin variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_sin(self) -> Expr

Unwraps this value to the Func::ArcSin variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_sin_ref(&self) -> &Expr

Unwraps this reference to the Func::ArcSin variant. Panics if this value is of any other type.

source

pub fn unwrap_cos(self) -> Expr

Unwraps this value to the Func::Cos variant. Panics if this value is of any other type.

source

pub fn unwrap_cos_ref(&self) -> &Expr

Unwraps this reference to the Func::Cos variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_cos(self) -> Expr

Unwraps this value to the Func::ArcCos variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_cos_ref(&self) -> &Expr

Unwraps this reference to the Func::ArcCos variant. Panics if this value is of any other type.

source

pub fn unwrap_tan(self) -> Expr

Unwraps this value to the Func::Tan variant. Panics if this value is of any other type.

source

pub fn unwrap_tan_ref(&self) -> &Expr

Unwraps this reference to the Func::Tan variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_tan(self) -> Expr

Unwraps this value to the Func::ArcTan variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_tan_ref(&self) -> &Expr

Unwraps this reference to the Func::ArcTan variant. Panics if this value is of any other type.

source

pub fn unwrap_sec(self) -> Expr

Unwraps this value to the Func::Sec variant. Panics if this value is of any other type.

source

pub fn unwrap_sec_ref(&self) -> &Expr

Unwraps this reference to the Func::Sec variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_sec(self) -> Expr

Unwraps this value to the Func::ArcSec variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_sec_ref(&self) -> &Expr

Unwraps this reference to the Func::ArcSec variant. Panics if this value is of any other type.

source

pub fn unwrap_cot(self) -> Expr

Unwraps this value to the Func::Cot variant. Panics if this value is of any other type.

source

pub fn unwrap_cot_ref(&self) -> &Expr

Unwraps this reference to the Func::Cot variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_cot(self) -> Expr

Unwraps this value to the Func::ArcCot variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_cot_ref(&self) -> &Expr

Unwraps this reference to the Func::ArcCot variant. Panics if this value is of any other type.

source

pub fn unwrap_csc(self) -> Expr

Unwraps this value to the Func::Csc variant. Panics if this value is of any other type.

source

pub fn unwrap_csc_ref(&self) -> &Expr

Unwraps this reference to the Func::Csc variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_csc(self) -> Expr

Unwraps this value to the Func::ArcCsc variant. Panics if this value is of any other type.

source

pub fn unwrap_arc_csc_ref(&self) -> &Expr

Unwraps this reference to the Func::ArcCsc variant. Panics if this value is of any other type.

source

pub fn unwrap_log(self) -> (Real, Expr)

Unwraps this value to the Func::Log variant. Panics if this value is of any other type.

source

pub fn unwrap_log_ref(&self) -> (&Real, &Expr)

Unwraps this reference to the Func::Log variant. Panics if this value is of any other type.

source§

impl Func

source

pub fn try_unwrap_sin(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::Sin variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_sin_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::Sin variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_sin(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::ArcSin variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_sin_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::ArcSin variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_cos(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::Cos variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_cos_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::Cos variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_cos(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::ArcCos variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_cos_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::ArcCos variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_tan(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::Tan variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_tan_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::Tan variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_tan(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::ArcTan variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_tan_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::ArcTan variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_sec(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::Sec variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_sec_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::Sec variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_sec(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::ArcSec variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_sec_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::ArcSec variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_cot(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::Cot variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_cot_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::Cot variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_cot(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::ArcCot variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_cot_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::ArcCot variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_csc(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::Csc variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_csc_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::Csc variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_csc(self) -> Result<Expr, TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::ArcCsc variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_arc_csc_ref(&self) -> Result<&Expr, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::ArcCsc variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_log(self) -> Result<(Real, Expr), TryUnwrapError<Self>>

Attempts to unwrap this value to the Func::Log variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source

pub fn try_unwrap_log_ref( &self, ) -> Result<(&Real, &Expr), TryUnwrapError<&Self>>

Attempts to unwrap this reference to the Func::Log variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

source§

impl Func

source

pub const fn is_sin(&self) -> bool

Returns true if this value is of type Sin. Returns false otherwise

source

pub const fn is_arc_sin(&self) -> bool

Returns true if this value is of type ArcSin. Returns false otherwise

source

pub const fn is_cos(&self) -> bool

Returns true if this value is of type Cos. Returns false otherwise

source

pub const fn is_arc_cos(&self) -> bool

Returns true if this value is of type ArcCos. Returns false otherwise

source

pub const fn is_tan(&self) -> bool

Returns true if this value is of type Tan. Returns false otherwise

source

pub const fn is_arc_tan(&self) -> bool

Returns true if this value is of type ArcTan. Returns false otherwise

source

pub const fn is_sec(&self) -> bool

Returns true if this value is of type Sec. Returns false otherwise

source

pub const fn is_arc_sec(&self) -> bool

Returns true if this value is of type ArcSec. Returns false otherwise

source

pub const fn is_cot(&self) -> bool

Returns true if this value is of type Cot. Returns false otherwise

source

pub const fn is_arc_cot(&self) -> bool

Returns true if this value is of type ArcCot. Returns false otherwise

source

pub const fn is_csc(&self) -> bool

Returns true if this value is of type Csc. Returns false otherwise

source

pub const fn is_arc_csc(&self) -> bool

Returns true if this value is of type ArcCsc. Returns false otherwise

source

pub const fn is_log(&self) -> bool

Returns true if this value is of type Log. Returns false otherwise

source§

impl Func

source

pub fn is_nat_log(&self) -> bool

source

pub fn is_trig(&self) -> bool

source

pub fn try_unwrap_log_base(&self, base: &Real) -> Option<&Expr>

source

pub fn try_unwrap_nat_log_ref(&self) -> Option<&Expr>

source

pub fn name(&self) -> String

source

pub fn derivative(&self, x: impl Borrow<Expr>) -> Expr

Trait Implementations§

source§

impl Clone for Func

source§

fn clone(&self) -> Func

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Func

source§

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

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

impl<'de> Deserialize<'de> for Func

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Func

source§

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

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

impl From<Func> for Atom

source§

fn from(value: Func) -> Self

Converts to this type from the input type.
source§

impl Hash for Func

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Func

source§

fn cmp(&self, other: &Func) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Func

source§

fn eq(&self, other: &Func) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Func

source§

fn partial_cmp(&self, other: &Func) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Func

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl SymbolicExpr for Func

source§

fn reduce(&self) -> Expr

basic simplification that can be applied regardless of context Read more
source§

fn args_mut(&mut self) -> &mut [Expr]

source§

fn args(&self) -> &[Expr]

source§

fn is_atom(&self) -> bool

source§

fn n_args(&self) -> usize

source§

fn iter_args(&self) -> impl Iterator<Item = &Expr>

source§

fn map_args(self, map_fn: impl Fn(&mut Expr)) -> Self

source§

impl Eq for Func

source§

impl StructuralPartialEq for Func

Auto Trait Implementations§

§

impl Freeze for Func

§

impl RefUnwindSafe for Func

§

impl !Send for Func

§

impl !Sync for Func

§

impl Unpin for Func

§

impl UnwindSafe for Func

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<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

source§

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 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,