Skip to main content

Expr

Enum Expr 

Source
pub enum Expr {
Show 24 variants Alias(Box<Expr>, Arc<str>), Column(Arc<str>), Columns(Vec<String>), DtypeColumn(Vec<DataType>), Literal(LiteralValue), BinaryExpr { left: Box<Expr>, op: Operator, right: Box<Expr>, }, Cast { expr: Box<Expr>, data_type: DataType, strict: bool, }, Sort { expr: Box<Expr>, options: SortOptions, }, Take { expr: Box<Expr>, idx: Box<Expr>, }, SortBy { expr: Box<Expr>, by: Vec<Expr>, reverse: Vec<bool>, }, Agg(AggExpr), Ternary { predicate: Box<Expr>, truthy: Box<Expr>, falsy: Box<Expr>, }, Function { input: Vec<Expr>, function: FunctionExpr, options: FunctionOptions, }, Explode(Box<Expr>), Filter { input: Box<Expr>, by: Box<Expr>, }, Window { function: Box<Expr>, partition_by: Vec<Expr>, order_by: Option<Box<Expr>>, options: WindowOptions, }, Wildcard, Slice { input: Box<Expr>, offset: Box<Expr>, length: Box<Expr>, }, Exclude(Box<Expr>, Vec<Excluded>), KeepName(Box<Expr>), Count, Nth(i64), RenameAlias { function: SpecialEq<Arc<dyn RenameAliasFn>>, expr: Box<Expr>, }, AnonymousFunction { input: Vec<Expr>, function: SpecialEq<Arc<dyn SeriesUdf>>, output_type: SpecialEq<Arc<dyn FunctionOutputField>>, options: FunctionOptions, },
}
Expand description

Queries consists of multiple expressions.

Variants§

§

Alias(Box<Expr>, Arc<str>)

§

Column(Arc<str>)

§

Columns(Vec<String>)

§

DtypeColumn(Vec<DataType>)

§

Literal(LiteralValue)

§

BinaryExpr

Fields

§left: Box<Expr>
§right: Box<Expr>
§

Cast

Fields

§expr: Box<Expr>
§data_type: DataType
§strict: bool
§

Sort

Fields

§expr: Box<Expr>
§options: SortOptions
§

Take

Fields

§expr: Box<Expr>
§idx: Box<Expr>
§

SortBy

Fields

§expr: Box<Expr>
§by: Vec<Expr>
§reverse: Vec<bool>
§

Agg(AggExpr)

§

Ternary

A ternary operation if true then “foo” else “bar”

Fields

§predicate: Box<Expr>
§truthy: Box<Expr>
§falsy: Box<Expr>
§

Function

Fields

§input: Vec<Expr>

function arguments

§function: FunctionExpr

function to apply

§

Explode(Box<Expr>)

§

Filter

Fields

§input: Box<Expr>
§by: Box<Expr>
§

Window

See postgres window functions

Fields

§function: Box<Expr>

Also has the input. i.e. avg(“foo”)

§partition_by: Vec<Expr>
§order_by: Option<Box<Expr>>
§

Wildcard

§

Slice

Fields

§input: Box<Expr>
§offset: Box<Expr>

length is not yet known so we accept negative offsets

§length: Box<Expr>
§

Exclude(Box<Expr>, Vec<Excluded>)

Can be used in a select statement to exclude a column from selection

§

KeepName(Box<Expr>)

Set root name as Alias

§

Count

Special case that does not need columns

§

Nth(i64)

Take the nth column in the DataFrame

§

RenameAlias

Fields

§function: SpecialEq<Arc<dyn RenameAliasFn>>
§expr: Box<Expr>
§

AnonymousFunction

Fields

§input: Vec<Expr>

function arguments

§function: SpecialEq<Arc<dyn SeriesUdf>>

function to apply

§output_type: SpecialEq<Arc<dyn FunctionOutputField>>

output dtype of the function

Implementations§

Source§

impl Expr

Source

pub fn to_dot(&self) -> Result<String, PolarsError>

Get a dot language representation of the Expression.

Source§

impl Expr

Source

pub fn to_field( &self, schema: &Schema, ctxt: Context, ) -> Result<Field, PolarsError>

Get Field result of the expression. The schema is the input data.

Source§

impl Expr

Source

pub fn eq<E>(self, other: E) -> Expr
where E: Into<Expr>,

Compare Expr with other Expr on equality

Source

pub fn neq<E>(self, other: E) -> Expr
where E: Into<Expr>,

Compare Expr with other Expr on non-equality

Source

pub fn lt<E>(self, other: E) -> Expr
where E: Into<Expr>,

Check if Expr < Expr

Source

pub fn gt<E>(self, other: E) -> Expr
where E: Into<Expr>,

Check if Expr > Expr

Source

pub fn gt_eq<E>(self, other: E) -> Expr
where E: Into<Expr>,

Check if Expr >= Expr

Source

pub fn lt_eq<E>(self, other: E) -> Expr
where E: Into<Expr>,

Check if Expr <= Expr

Source

pub fn not(self) -> Expr

Negate Expr

Source

pub fn alias(self, name: &str) -> Expr

Rename Column.

Source

pub fn is_null(self) -> Expr

Run is_null operation on Expr.

Source

pub fn is_not_null(self) -> Expr

Run is_not_null operation on Expr.

Source

pub fn drop_nulls(self) -> Expr

Drop null values

Source

pub fn drop_nans(self) -> Expr

Drop NaN values

Source

pub fn min(self) -> Expr

Reduce groups to minimal value.

Source

pub fn max(self) -> Expr

Reduce groups to maximum value.

Source

pub fn nan_min(self) -> Expr

Reduce groups to minimal value.

Source

pub fn nan_max(self) -> Expr

Reduce groups to maximum value.

Source

pub fn mean(self) -> Expr

Reduce groups to the mean value.

Source

pub fn median(self) -> Expr

Reduce groups to the median value.

Source

pub fn sum(self) -> Expr

Reduce groups to the sum of all the values.

Source

pub fn n_unique(self) -> Expr

Get the number of unique values in the groups.

Source

pub fn first(self) -> Expr

Get the first value in the group.

Source

pub fn last(self) -> Expr

Get the last value in the group.

Source

pub fn list(self) -> Expr

Aggregate the group to a Series

Source

pub fn quantile(self, quantile: f64, interpol: QuantileInterpolOptions) -> Expr

Compute the quantile per group.

Source

pub fn agg_groups(self) -> Expr

Get the group indexes of the group by operation.

Source

pub fn flatten(self) -> Expr

Alias for explode

Source

pub fn explode(self) -> Expr

Explode the utf8/ list column

Source

pub fn slice<E, F>(self, offset: E, length: F) -> Expr
where E: Into<Expr>, F: Into<Expr>,

Slice the Series. offset may be negative.

Source

pub fn append<E>(self, other: E, upcast: bool) -> Expr
where E: Into<Expr>,

Append expressions. This is done by adding the chunks of other to this Series.

Source

pub fn head(self, length: Option<usize>) -> Expr

Get the first n elements of the Expr result

Source

pub fn tail(self, length: Option<usize>) -> Expr

Get the last n elements of the Expr result

Source

pub fn unique(self) -> Expr

Get unique values of this expression.

Source

pub fn unique_stable(self) -> Expr

Get unique values of this expression, while maintaining order. This requires more work than Expr::unique.

Source

pub fn arg_unique(self) -> Expr

Get the first index of unique values of this expression.

Source

pub fn arg_min(self) -> Expr

Get the index value that has the minimum value

Source

pub fn arg_max(self) -> Expr

Get the index value that has the maximum value

Source

pub fn arg_sort(self, sort_options: SortOptions) -> Expr

Get the index values that would sort this expression.

Source

pub fn strict_cast(self, data_type: DataType) -> Expr

Cast expression to another data type. Throws an error if conversion had overflows

Source

pub fn cast(self, data_type: DataType) -> Expr

Cast expression to another data type.

Source

pub fn take<E>(self, idx: E) -> Expr
where E: Into<Expr>,

Take the values by idx.

Source

pub fn sort(self, reverse: bool) -> Expr

Sort in increasing order. See the eager implementation.

Source

pub fn sort_with(self, options: SortOptions) -> Expr

Sort with given options.

Source

pub fn reverse(self) -> Expr

Reverse column

Source

pub fn map<F>( self, function: F, output_type: SpecialEq<Arc<dyn FunctionOutputField>>, ) -> Expr
where F: Fn(Series) -> Result<Series, PolarsError> + 'static + Send + Sync,

Apply a function/closure once the logical plan get executed.

This function is very similar to Expr::apply, but differs in how it handles aggregations.

  • map should be used for operations that are independent of groups, e.g. multiply * 2, or raise to the power
  • apply should be used for operations that work on a group of data. e.g. sum, count, etc.

It is the responsibility of the caller that the schema is correct by giving the correct output_type. If None given the output type of the input expr is used.

Source

pub fn map_many<F>( self, function: F, arguments: &[Expr], output_type: SpecialEq<Arc<dyn FunctionOutputField>>, ) -> Expr
where F: Fn(&mut [Series]) -> Result<Series, PolarsError> + 'static + Send + Sync,

Apply a function/closure once the logical plan get executed with many arguments

See the Expr::map function for the differences between map and apply.

Source

pub fn map_list<F>( self, function: F, output_type: SpecialEq<Arc<dyn FunctionOutputField>>, ) -> Expr
where F: Fn(Series) -> Result<Series, PolarsError> + 'static + Send + Sync,

Apply a function/closure once the logical plan get executed.

This function is very similar to apply, but differs in how it handles aggregations.

  • map should be used for operations that are independent of groups, e.g. multiply * 2, or raise to the power
  • apply should be used for operations that work on a group of data. e.g. sum, count, etc.
  • map_list should be used when the function expects a list aggregated series.
Source

pub fn function_with_options<F>( self, function: F, output_type: SpecialEq<Arc<dyn FunctionOutputField>>, options: FunctionOptions, ) -> Expr
where F: Fn(Series) -> Result<Series, PolarsError> + 'static + Send + Sync,

A function that cannot be expressed with map or apply and requires extra settings.

Source

pub fn apply<F>( self, function: F, output_type: SpecialEq<Arc<dyn FunctionOutputField>>, ) -> Expr
where F: Fn(Series) -> Result<Series, PolarsError> + 'static + Send + Sync,

Apply a function/closure over the groups. This should only be used in a groupby aggregation.

It is the responsibility of the caller that the schema is correct by giving the correct output_type. If None given the output type of the input expr is used.

This difference with map is that apply will create a separate Series per group.

  • map should be used for operations that are independent of groups, e.g. multiply * 2, or raise to the power
  • apply should be used for operations that work on a group of data. e.g. sum, count, etc.
Source

pub fn apply_many<F>( self, function: F, arguments: &[Expr], output_type: SpecialEq<Arc<dyn FunctionOutputField>>, ) -> Expr
where F: Fn(&mut [Series]) -> Result<Series, PolarsError> + 'static + Send + Sync,

Apply a function/closure over the groups with many arguments. This should only be used in a groupby aggregation.

See the Expr::apply function for the differences between map and apply.

Source

pub fn apply_many_private( self, function_expr: FunctionExpr, arguments: &[Expr], auto_explode: bool, cast_to_supertypes: bool, ) -> Expr

Source

pub fn map_many_private( self, function_expr: FunctionExpr, arguments: &[Expr], cast_to_supertypes: bool, ) -> Expr

Source

pub fn is_finite(self) -> Expr

Get mask of finite values if dtype is Float

Source

pub fn is_infinite(self) -> Expr

Get mask of infinite values if dtype is Float

Source

pub fn is_nan(self) -> Expr

Get mask of NaN values if dtype is Float

Source

pub fn is_not_nan(self) -> Expr

Get inverse mask of NaN values if dtype is Float

Source

pub fn shift(self, periods: i64) -> Expr

Shift the values in the array by some period. See the eager implementation.

Source

pub fn shift_and_fill<E>(self, periods: i64, fill_value: E) -> Expr
where E: Into<Expr>,

Shift the values in the array by some period and fill the resulting empty values.

Source

pub fn cumsum(self, reverse: bool) -> Expr

Get an array with the cumulative sum computed at every element

Source

pub fn cumprod(self, reverse: bool) -> Expr

Get an array with the cumulative product computed at every element

Source

pub fn cummin(self, reverse: bool) -> Expr

Get an array with the cumulative min computed at every element

Source

pub fn cummax(self, reverse: bool) -> Expr

Get an array with the cumulative max computed at every element

Source

pub fn product(self) -> Expr

Get the product aggregation of an expression

Source

pub fn backward_fill(self, limit: Option<u32>) -> Expr

Fill missing value with next non-null.

Source

pub fn forward_fill(self, limit: Option<u32>) -> Expr

Fill missing value with previous non-null.

Source

pub fn over<E, IE>(self, partition_by: E) -> Expr
where E: AsRef<[IE]>, IE: Into<Expr> + Clone,

Apply window function over a subgroup. This is similar to a groupby + aggregation + self join. Or similar to window functions in Postgres.

§Example
#[macro_use] extern crate polars_core;
use polars_core::prelude::*;
use polars_lazy::prelude::*;

fn example() -> PolarsResult<()> {
    let df = df! {
            "groups" => &[1, 1, 2, 2, 1, 2, 3, 3, 1],
            "values" => &[1, 2, 3, 4, 5, 6, 7, 8, 8]
        }?;

    let out = df
     .lazy()
     .select(&[
         col("groups"),
         sum("values").over([col("groups")]),
     ])
     .collect()?;
    dbg!(&out);
    Ok(())
}

Outputs:

╭────────┬────────╮
│ groups ┆ values │
│ ---    ┆ ---    │
│ i32    ┆ i32    │
╞════════╪════════╡
│ 1      ┆ 16     │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ 1      ┆ 16     │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ 2      ┆ 13     │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ 2      ┆ 13     │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ ...    ┆ ...    │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ 1      ┆ 16     │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ 2      ┆ 13     │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ 3      ┆ 15     │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ 3      ┆ 15     │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ 1      ┆ 16     │
╰────────┴────────╯
Source

pub fn fill_null<E>(self, fill_value: E) -> Expr
where E: Into<Expr>,

Replace the null values by a value.

Source

pub fn fill_nan<E>(self, fill_value: E) -> Expr
where E: Into<Expr>,

Replace the floating point NaN values by a value.

Source

pub fn count(self) -> Expr

Count the values of the Series or Get counts of the group by operation.

Source

pub fn std(self, ddof: u8) -> Expr

Standard deviation of the values of the Series

Source

pub fn var(self, ddof: u8) -> Expr

Variance of the values of the Series

Source

pub fn is_duplicated(self) -> Expr

Get a mask of duplicated values

Source

pub fn is_unique(self) -> Expr

Get a mask of unique values

Source

pub fn and<E>(self, expr: E) -> Expr
where E: Into<Expr>,

and operation

Source

pub fn xor<E>(self, expr: E) -> Expr
where E: Into<Expr>,

Source

pub fn or<E>(self, expr: E) -> Expr
where E: Into<Expr>,

or operation

Source

pub fn pow<E>(self, exponent: E) -> Expr
where E: Into<Expr>,

Raise expression to the power exponent

Source

pub fn filter<E>(self, predicate: E) -> Expr
where E: Into<Expr>,

Filter a single column Should be used in aggregation context. If you want to filter on a DataFrame level, use LazyFrame::filter

Source

pub fn is_in<E>(self, other: E) -> Expr
where E: Into<Expr>,

Check if the values of the left expression are in the lists of the right expr.

Source

pub fn sort_by<E, IE, R>(self, by: E, reverse: R) -> Expr
where E: AsRef<[IE]>, IE: Into<Expr> + Clone, R: AsRef<[bool]>,

Sort this column by the ordering of another column. Can also be used in a groupby context to sort the groups.

Source

pub fn keep_name(self) -> Expr

Keep the original root name

use polars_core::prelude::*;
use polars_lazy::prelude::*;

fn example(df: LazyFrame) -> LazyFrame {
    df.select([
// even thought the alias yields a different column name,
// `keep_name` will make sure that the original column name is used
        col("*").alias("foo").keep_name()
])
}
Source

pub fn map_alias<F>(self, function: F) -> Expr
where F: Fn(&str) -> String + 'static + Send + Sync,

Define an alias by mapping a function over the original root column name.

Source

pub fn suffix(self, suffix: &str) -> Expr

Add a suffix to the root column name.

Source

pub fn prefix(self, prefix: &str) -> Expr

Add a prefix to the root column name.

Source

pub fn exclude(self, columns: impl IntoVec<String>) -> Expr

Exclude a column from a wildcard/regex selection.

You may also use regexes in the exclude as long as they start with ^ and end with $/

§Example
use polars_core::prelude::*;
use polars_lazy::prelude::*;

// Select all columns except foo.
fn example(df: DataFrame) -> LazyFrame {
      df.lazy()
        .select(&[
                col("*").exclude(&["foo"])
                ])
}
Source

pub fn exclude_dtype<D>(self, dtypes: D) -> Expr
where D: AsRef<[DataType]>,

Source

pub fn upper_bound(self) -> Expr

Get maximal value that could be hold by this dtype.

Source

pub fn lower_bound(self) -> Expr

Get minimal value that could be hold by this dtype.

Source

pub fn reshape(self, dims: &[i64]) -> Expr

Source

pub fn cumcount(self, reverse: bool) -> Expr

Cumulatively count values from 0 to len.

Source

pub fn any(self) -> Expr

Check if any boolean value is true

Source

pub fn shrink_dtype(self) -> Expr

Shrink numeric columns to the minimal required datatype needed to fit the extrema of this Series. This can be used to reduce memory pressure.

Source

pub fn all(self) -> Expr

Check if all boolean values are true

Source

pub fn null_count(self) -> Expr

Get the null count of the column/group

Source

pub fn set_sorted(self, sorted: IsSorted) -> Expr

Set this Series as sorted so that downstream code can use fast paths for sorted arrays.

§Warning

This can lead to incorrect results if this Series is not sorted!! Use with care!

Source

pub fn str(self) -> StringNameSpace

Source

pub fn dt(self) -> DateLikeNameSpace

Source

pub fn arr(self) -> ListNameSpace

Source

pub fn cat(self) -> CategoricalNameSpace

Source§

impl Expr

Source

pub fn mutate(&mut self) -> ExprMut<'_>

Expr::mutate().apply(fn())

Trait Implementations§

Source§

impl Add for Expr

Source§

type Output = Expr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Expr) -> <Expr as Add>::Output

Performs the + operation. Read more
Source§

impl AsRef<Expr> for AggExpr

Source§

fn as_ref(&self) -> &Expr

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for Expr

Source§

fn clone(&self) -> Expr

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Expr

Source§

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

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

impl Default for Expr

Source§

fn default() -> Expr

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

impl Display for Expr

Source§

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

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

impl Div for Expr

Source§

type Output = Expr

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Expr) -> <Expr as Div>::Output

Performs the / operation. Read more
Source§

impl Eq for Expr

Source§

impl From<&str> for Expr

Source§

fn from(s: &str) -> Expr

Converts to this type from the input type.
Source§

impl From<AggExpr> for Expr

Source§

fn from(agg: AggExpr) -> Expr

Converts to this type from the input type.
Source§

impl From<bool> for Expr

Source§

fn from(val: bool) -> Expr

Converts to this type from the input type.
Source§

impl From<f32> for Expr

Source§

fn from(val: f32) -> Expr

Converts to this type from the input type.
Source§

impl From<f64> for Expr

Source§

fn from(val: f64) -> Expr

Converts to this type from the input type.
Source§

impl From<i32> for Expr

Source§

fn from(val: i32) -> Expr

Converts to this type from the input type.
Source§

impl From<i64> for Expr

Source§

fn from(val: i64) -> Expr

Converts to this type from the input type.
Source§

impl From<u8> for Expr

Source§

fn from(val: u8) -> Expr

Converts to this type from the input type.
Source§

impl From<u16> for Expr

Source§

fn from(val: u16) -> Expr

Converts to this type from the input type.
Source§

impl From<u32> for Expr

Source§

fn from(val: u32) -> Expr

Converts to this type from the input type.
Source§

impl From<u64> for Expr

Source§

fn from(val: u64) -> Expr

Converts to this type from the input type.
Source§

impl Hash for Expr

Source§

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

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<'a> IntoIterator for &'a Expr

Source§

type Item = &'a Expr

The type of the elements being iterated over.
Source§

type IntoIter = ExprIter<'a>

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

fn into_iter(self) -> <&'a Expr as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl Mul for Expr

Source§

type Output = Expr

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Expr) -> <Expr as Mul>::Output

Performs the * operation. Read more
Source§

impl PartialEq for Expr

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Rem for Expr

Source§

type Output = Expr

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Expr) -> <Expr as Rem>::Output

Performs the % operation. Read more
Source§

impl StructuralPartialEq for Expr

Source§

impl Sub for Expr

Source§

type Output = Expr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Expr) -> <Expr as Sub>::Output

Performs the - operation. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Expr

§

impl !UnwindSafe for Expr

§

impl Freeze for Expr

§

impl Send for Expr

§

impl Sync for Expr

§

impl Unpin for Expr

§

impl UnsafeUnpin for Expr

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

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

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§

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 = !

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V