Skip to main content

Expr

Enum Expr 

Source
pub enum Expr {
Show 33 variants BoolOp(ExprBoolOp), Named(ExprNamed), BinOp(ExprBinOp), UnaryOp(ExprUnaryOp), Lambda(ExprLambda), If(ExprIf), Dict(ExprDict), Set(ExprSet), ListComp(ExprListComp), SetComp(ExprSetComp), DictComp(ExprDictComp), Generator(ExprGenerator), Await(ExprAwait), Yield(ExprYield), YieldFrom(ExprYieldFrom), Compare(ExprCompare), Call(ExprCall), FString(ExprFString), TString(ExprTString), StringLiteral(ExprStringLiteral), BytesLiteral(ExprBytesLiteral), NumberLiteral(ExprNumberLiteral), BooleanLiteral(ExprBooleanLiteral), NoneLiteral(ExprNoneLiteral), EllipsisLiteral(ExprEllipsisLiteral), Attribute(ExprAttribute), Subscript(ExprSubscript), Starred(ExprStarred), Name(ExprName), List(ExprList), Tuple(ExprTuple), Slice(ExprSlice), IpyEscapeCommand(ExprIpyEscapeCommand),
}
Expand description

See also expr

Variants§

§

BoolOp(ExprBoolOp)

§

Named(ExprNamed)

§

BinOp(ExprBinOp)

§

UnaryOp(ExprUnaryOp)

§

Lambda(ExprLambda)

§

If(ExprIf)

§

Dict(ExprDict)

§

Set(ExprSet)

§

ListComp(ExprListComp)

§

SetComp(ExprSetComp)

§

DictComp(ExprDictComp)

§

Generator(ExprGenerator)

§

Await(ExprAwait)

§

Yield(ExprYield)

§

YieldFrom(ExprYieldFrom)

§

Compare(ExprCompare)

§

Call(ExprCall)

§

FString(ExprFString)

§

TString(ExprTString)

§

StringLiteral(ExprStringLiteral)

§

BytesLiteral(ExprBytesLiteral)

§

NumberLiteral(ExprNumberLiteral)

§

BooleanLiteral(ExprBooleanLiteral)

§

NoneLiteral(ExprNoneLiteral)

§

EllipsisLiteral(ExprEllipsisLiteral)

§

Attribute(ExprAttribute)

§

Subscript(ExprSubscript)

§

Starred(ExprStarred)

§

Name(ExprName)

§

List(ExprList)

§

Tuple(ExprTuple)

§

Slice(ExprSlice)

§

IpyEscapeCommand(ExprIpyEscapeCommand)

Implementations§

Source§

impl Expr

Source

pub const fn is_bool_op_expr(&self) -> bool

Source

pub fn bool_op_expr(self) -> Option<ExprBoolOp>

Source

pub fn expect_bool_op_expr(self) -> ExprBoolOp

Source

pub fn as_bool_op_expr_mut(&mut self) -> Option<&mut ExprBoolOp>

Source

pub fn as_bool_op_expr(&self) -> Option<&ExprBoolOp>

Source

pub const fn is_named_expr(&self) -> bool

Source

pub fn named_expr(self) -> Option<ExprNamed>

Source

pub fn expect_named_expr(self) -> ExprNamed

Source

pub fn as_named_expr_mut(&mut self) -> Option<&mut ExprNamed>

Source

pub fn as_named_expr(&self) -> Option<&ExprNamed>

Source

pub const fn is_bin_op_expr(&self) -> bool

Source

pub fn bin_op_expr(self) -> Option<ExprBinOp>

Source

pub fn expect_bin_op_expr(self) -> ExprBinOp

Source

pub fn as_bin_op_expr_mut(&mut self) -> Option<&mut ExprBinOp>

Source

pub fn as_bin_op_expr(&self) -> Option<&ExprBinOp>

Source

pub const fn is_unary_op_expr(&self) -> bool

Source

pub fn unary_op_expr(self) -> Option<ExprUnaryOp>

Source

pub fn expect_unary_op_expr(self) -> ExprUnaryOp

Source

pub fn as_unary_op_expr_mut(&mut self) -> Option<&mut ExprUnaryOp>

Source

pub fn as_unary_op_expr(&self) -> Option<&ExprUnaryOp>

Source

pub const fn is_lambda_expr(&self) -> bool

Source

pub fn lambda_expr(self) -> Option<ExprLambda>

Source

pub fn expect_lambda_expr(self) -> ExprLambda

Source

pub fn as_lambda_expr_mut(&mut self) -> Option<&mut ExprLambda>

Source

pub fn as_lambda_expr(&self) -> Option<&ExprLambda>

Source

pub const fn is_if_expr(&self) -> bool

Source

pub fn if_expr(self) -> Option<ExprIf>

Source

pub fn expect_if_expr(self) -> ExprIf

Source

pub fn as_if_expr_mut(&mut self) -> Option<&mut ExprIf>

Source

pub fn as_if_expr(&self) -> Option<&ExprIf>

Source

pub const fn is_dict_expr(&self) -> bool

Source

pub fn dict_expr(self) -> Option<ExprDict>

Source

pub fn expect_dict_expr(self) -> ExprDict

Source

pub fn as_dict_expr_mut(&mut self) -> Option<&mut ExprDict>

Source

pub fn as_dict_expr(&self) -> Option<&ExprDict>

Source

pub const fn is_set_expr(&self) -> bool

Source

pub fn set_expr(self) -> Option<ExprSet>

Source

pub fn expect_set_expr(self) -> ExprSet

Source

pub fn as_set_expr_mut(&mut self) -> Option<&mut ExprSet>

Source

pub fn as_set_expr(&self) -> Option<&ExprSet>

Source

pub const fn is_list_comp_expr(&self) -> bool

Source

pub fn list_comp_expr(self) -> Option<ExprListComp>

Source

pub fn expect_list_comp_expr(self) -> ExprListComp

Source

pub fn as_list_comp_expr_mut(&mut self) -> Option<&mut ExprListComp>

Source

pub fn as_list_comp_expr(&self) -> Option<&ExprListComp>

Source

pub const fn is_set_comp_expr(&self) -> bool

Source

pub fn set_comp_expr(self) -> Option<ExprSetComp>

Source

pub fn expect_set_comp_expr(self) -> ExprSetComp

Source

pub fn as_set_comp_expr_mut(&mut self) -> Option<&mut ExprSetComp>

Source

pub fn as_set_comp_expr(&self) -> Option<&ExprSetComp>

Source

pub const fn is_dict_comp_expr(&self) -> bool

Source

pub fn dict_comp_expr(self) -> Option<ExprDictComp>

Source

pub fn expect_dict_comp_expr(self) -> ExprDictComp

Source

pub fn as_dict_comp_expr_mut(&mut self) -> Option<&mut ExprDictComp>

Source

pub fn as_dict_comp_expr(&self) -> Option<&ExprDictComp>

Source

pub const fn is_generator_expr(&self) -> bool

Source

pub fn generator_expr(self) -> Option<ExprGenerator>

Source

pub fn expect_generator_expr(self) -> ExprGenerator

Source

pub fn as_generator_expr_mut(&mut self) -> Option<&mut ExprGenerator>

Source

pub fn as_generator_expr(&self) -> Option<&ExprGenerator>

Source

pub const fn is_await_expr(&self) -> bool

Source

pub fn await_expr(self) -> Option<ExprAwait>

Source

pub fn expect_await_expr(self) -> ExprAwait

Source

pub fn as_await_expr_mut(&mut self) -> Option<&mut ExprAwait>

Source

pub fn as_await_expr(&self) -> Option<&ExprAwait>

Source

pub const fn is_yield_expr(&self) -> bool

Source

pub fn yield_expr(self) -> Option<ExprYield>

Source

pub fn expect_yield_expr(self) -> ExprYield

Source

pub fn as_yield_expr_mut(&mut self) -> Option<&mut ExprYield>

Source

pub fn as_yield_expr(&self) -> Option<&ExprYield>

Source

pub const fn is_yield_from_expr(&self) -> bool

Source

pub fn yield_from_expr(self) -> Option<ExprYieldFrom>

Source

pub fn expect_yield_from_expr(self) -> ExprYieldFrom

Source

pub fn as_yield_from_expr_mut(&mut self) -> Option<&mut ExprYieldFrom>

Source

pub fn as_yield_from_expr(&self) -> Option<&ExprYieldFrom>

Source

pub const fn is_compare_expr(&self) -> bool

Source

pub fn compare_expr(self) -> Option<ExprCompare>

Source

pub fn expect_compare_expr(self) -> ExprCompare

Source

pub fn as_compare_expr_mut(&mut self) -> Option<&mut ExprCompare>

Source

pub fn as_compare_expr(&self) -> Option<&ExprCompare>

Source

pub const fn is_call_expr(&self) -> bool

Source

pub fn call_expr(self) -> Option<ExprCall>

Source

pub fn expect_call_expr(self) -> ExprCall

Source

pub fn as_call_expr_mut(&mut self) -> Option<&mut ExprCall>

Source

pub fn as_call_expr(&self) -> Option<&ExprCall>

Source

pub const fn is_f_string_expr(&self) -> bool

Source

pub fn f_string_expr(self) -> Option<ExprFString>

Source

pub fn expect_f_string_expr(self) -> ExprFString

Source

pub fn as_f_string_expr_mut(&mut self) -> Option<&mut ExprFString>

Source

pub fn as_f_string_expr(&self) -> Option<&ExprFString>

Source

pub const fn is_t_string_expr(&self) -> bool

Source

pub fn t_string_expr(self) -> Option<ExprTString>

Source

pub fn expect_t_string_expr(self) -> ExprTString

Source

pub fn as_t_string_expr_mut(&mut self) -> Option<&mut ExprTString>

Source

pub fn as_t_string_expr(&self) -> Option<&ExprTString>

Source

pub const fn is_string_literal_expr(&self) -> bool

Source

pub fn string_literal_expr(self) -> Option<ExprStringLiteral>

Source

pub fn expect_string_literal_expr(self) -> ExprStringLiteral

Source

pub fn as_string_literal_expr_mut(&mut self) -> Option<&mut ExprStringLiteral>

Source

pub fn as_string_literal_expr(&self) -> Option<&ExprStringLiteral>

Source

pub const fn is_bytes_literal_expr(&self) -> bool

Source

pub fn bytes_literal_expr(self) -> Option<ExprBytesLiteral>

Source

pub fn expect_bytes_literal_expr(self) -> ExprBytesLiteral

Source

pub fn as_bytes_literal_expr_mut(&mut self) -> Option<&mut ExprBytesLiteral>

Source

pub fn as_bytes_literal_expr(&self) -> Option<&ExprBytesLiteral>

Source

pub const fn is_number_literal_expr(&self) -> bool

Source

pub fn number_literal_expr(self) -> Option<ExprNumberLiteral>

Source

pub fn expect_number_literal_expr(self) -> ExprNumberLiteral

Source

pub fn as_number_literal_expr_mut(&mut self) -> Option<&mut ExprNumberLiteral>

Source

pub fn as_number_literal_expr(&self) -> Option<&ExprNumberLiteral>

Source

pub const fn is_boolean_literal_expr(&self) -> bool

Source

pub fn boolean_literal_expr(self) -> Option<ExprBooleanLiteral>

Source

pub fn expect_boolean_literal_expr(self) -> ExprBooleanLiteral

Source

pub fn as_boolean_literal_expr_mut(&mut self) -> Option<&mut ExprBooleanLiteral>

Source

pub fn as_boolean_literal_expr(&self) -> Option<&ExprBooleanLiteral>

Source

pub const fn is_none_literal_expr(&self) -> bool

Source

pub fn none_literal_expr(self) -> Option<ExprNoneLiteral>

Source

pub fn expect_none_literal_expr(self) -> ExprNoneLiteral

Source

pub fn as_none_literal_expr_mut(&mut self) -> Option<&mut ExprNoneLiteral>

Source

pub fn as_none_literal_expr(&self) -> Option<&ExprNoneLiteral>

Source

pub const fn is_ellipsis_literal_expr(&self) -> bool

Source

pub fn ellipsis_literal_expr(self) -> Option<ExprEllipsisLiteral>

Source

pub fn expect_ellipsis_literal_expr(self) -> ExprEllipsisLiteral

Source

pub fn as_ellipsis_literal_expr_mut( &mut self, ) -> Option<&mut ExprEllipsisLiteral>

Source

pub fn as_ellipsis_literal_expr(&self) -> Option<&ExprEllipsisLiteral>

Source

pub const fn is_attribute_expr(&self) -> bool

Source

pub fn attribute_expr(self) -> Option<ExprAttribute>

Source

pub fn expect_attribute_expr(self) -> ExprAttribute

Source

pub fn as_attribute_expr_mut(&mut self) -> Option<&mut ExprAttribute>

Source

pub fn as_attribute_expr(&self) -> Option<&ExprAttribute>

Source

pub const fn is_subscript_expr(&self) -> bool

Source

pub fn subscript_expr(self) -> Option<ExprSubscript>

Source

pub fn expect_subscript_expr(self) -> ExprSubscript

Source

pub fn as_subscript_expr_mut(&mut self) -> Option<&mut ExprSubscript>

Source

pub fn as_subscript_expr(&self) -> Option<&ExprSubscript>

Source

pub const fn is_starred_expr(&self) -> bool

Source

pub fn starred_expr(self) -> Option<ExprStarred>

Source

pub fn expect_starred_expr(self) -> ExprStarred

Source

pub fn as_starred_expr_mut(&mut self) -> Option<&mut ExprStarred>

Source

pub fn as_starred_expr(&self) -> Option<&ExprStarred>

Source

pub const fn is_name_expr(&self) -> bool

Source

pub fn name_expr(self) -> Option<ExprName>

Source

pub fn expect_name_expr(self) -> ExprName

Source

pub fn as_name_expr_mut(&mut self) -> Option<&mut ExprName>

Source

pub fn as_name_expr(&self) -> Option<&ExprName>

Source

pub const fn is_list_expr(&self) -> bool

Source

pub fn list_expr(self) -> Option<ExprList>

Source

pub fn expect_list_expr(self) -> ExprList

Source

pub fn as_list_expr_mut(&mut self) -> Option<&mut ExprList>

Source

pub fn as_list_expr(&self) -> Option<&ExprList>

Source

pub const fn is_tuple_expr(&self) -> bool

Source

pub fn tuple_expr(self) -> Option<ExprTuple>

Source

pub fn expect_tuple_expr(self) -> ExprTuple

Source

pub fn as_tuple_expr_mut(&mut self) -> Option<&mut ExprTuple>

Source

pub fn as_tuple_expr(&self) -> Option<&ExprTuple>

Source

pub const fn is_slice_expr(&self) -> bool

Source

pub fn slice_expr(self) -> Option<ExprSlice>

Source

pub fn expect_slice_expr(self) -> ExprSlice

Source

pub fn as_slice_expr_mut(&mut self) -> Option<&mut ExprSlice>

Source

pub fn as_slice_expr(&self) -> Option<&ExprSlice>

Source

pub const fn is_ipy_escape_command_expr(&self) -> bool

Source

pub fn ipy_escape_command_expr(self) -> Option<ExprIpyEscapeCommand>

Source

pub fn expect_ipy_escape_command_expr(self) -> ExprIpyEscapeCommand

Source

pub fn as_ipy_escape_command_expr_mut( &mut self, ) -> Option<&mut ExprIpyEscapeCommand>

Source

pub fn as_ipy_escape_command_expr(&self) -> Option<&ExprIpyEscapeCommand>

Source§

impl Expr

Source

pub fn is_literal_expr(&self) -> bool

Returns true if the expression is a literal expression.

A literal expression is either a string literal, bytes literal, integer, float, complex number, boolean, None, or ellipsis (...).

Source

pub fn as_literal_expr(&self) -> Option<LiteralExpressionRef<'_>>

Returns LiteralExpressionRef if the expression is a literal expression.

Source

pub fn precedence(&self) -> OperatorPrecedence

Return the OperatorPrecedence of this expression

Trait Implementations§

Source§

impl Clone for Expr

Source§

fn clone(&self) -> Expr

Returns a duplicate 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 Expr

Source§

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

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

impl<'a> From<&'a Expr> for AnyNodeRef<'a>

Source§

fn from(node: &'a Expr) -> AnyNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Expr> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Expr) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Expr> for ArgOrKeyword<'a>

Source§

fn from(arg: &'a Expr) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Expr> for ComparableExpr<'a>

Source§

fn from(expr: &'a Expr) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Expr> for ExprRef<'a>

Source§

fn from(node: &'a Expr) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Expr> for HashableExpr<'a>

Source§

fn from(expr: &'a Expr) -> Self

Converts to this type from the input type.
Source§

impl From<&Expr> for OperatorPrecedence

Source§

fn from(expr: &Expr) -> Self

Converts to this type from the input type.
Source§

impl From<BytesLiteral> for Expr

Source§

fn from(payload: BytesLiteral) -> Self

Converts to this type from the input type.
Source§

impl From<ExprAttribute> for Expr

Source§

fn from(node: ExprAttribute) -> Self

Converts to this type from the input type.
Source§

impl From<ExprAwait> for Expr

Source§

fn from(node: ExprAwait) -> Self

Converts to this type from the input type.
Source§

impl From<ExprBinOp> for Expr

Source§

fn from(node: ExprBinOp) -> Self

Converts to this type from the input type.
Source§

impl From<ExprBoolOp> for Expr

Source§

fn from(node: ExprBoolOp) -> Self

Converts to this type from the input type.
Source§

impl From<ExprBooleanLiteral> for Expr

Source§

fn from(node: ExprBooleanLiteral) -> Self

Converts to this type from the input type.
Source§

impl From<ExprBytesLiteral> for Expr

Source§

fn from(node: ExprBytesLiteral) -> Self

Converts to this type from the input type.
Source§

impl From<ExprCall> for Expr

Source§

fn from(node: ExprCall) -> Self

Converts to this type from the input type.
Source§

impl From<ExprCompare> for Expr

Source§

fn from(node: ExprCompare) -> Self

Converts to this type from the input type.
Source§

impl From<ExprDict> for Expr

Source§

fn from(node: ExprDict) -> Self

Converts to this type from the input type.
Source§

impl From<ExprDictComp> for Expr

Source§

fn from(node: ExprDictComp) -> Self

Converts to this type from the input type.
Source§

impl From<ExprEllipsisLiteral> for Expr

Source§

fn from(node: ExprEllipsisLiteral) -> Self

Converts to this type from the input type.
Source§

impl From<ExprFString> for Expr

Source§

fn from(node: ExprFString) -> Self

Converts to this type from the input type.
Source§

impl From<ExprGenerator> for Expr

Source§

fn from(node: ExprGenerator) -> Self

Converts to this type from the input type.
Source§

impl From<ExprIf> for Expr

Source§

fn from(node: ExprIf) -> Self

Converts to this type from the input type.
Source§

impl From<ExprIpyEscapeCommand> for Expr

Source§

fn from(node: ExprIpyEscapeCommand) -> Self

Converts to this type from the input type.
Source§

impl From<ExprLambda> for Expr

Source§

fn from(node: ExprLambda) -> Self

Converts to this type from the input type.
Source§

impl From<ExprList> for Expr

Source§

fn from(node: ExprList) -> Self

Converts to this type from the input type.
Source§

impl From<ExprListComp> for Expr

Source§

fn from(node: ExprListComp) -> Self

Converts to this type from the input type.
Source§

impl From<ExprName> for Expr

Source§

fn from(node: ExprName) -> Self

Converts to this type from the input type.
Source§

impl From<ExprNamed> for Expr

Source§

fn from(node: ExprNamed) -> Self

Converts to this type from the input type.
Source§

impl From<ExprNoneLiteral> for Expr

Source§

fn from(node: ExprNoneLiteral) -> Self

Converts to this type from the input type.
Source§

impl From<ExprNumberLiteral> for Expr

Source§

fn from(node: ExprNumberLiteral) -> Self

Converts to this type from the input type.
Source§

impl From<ExprSet> for Expr

Source§

fn from(node: ExprSet) -> Self

Converts to this type from the input type.
Source§

impl From<ExprSetComp> for Expr

Source§

fn from(node: ExprSetComp) -> Self

Converts to this type from the input type.
Source§

impl From<ExprSlice> for Expr

Source§

fn from(node: ExprSlice) -> Self

Converts to this type from the input type.
Source§

impl From<ExprStarred> for Expr

Source§

fn from(node: ExprStarred) -> Self

Converts to this type from the input type.
Source§

impl From<ExprStringLiteral> for Expr

Source§

fn from(node: ExprStringLiteral) -> Self

Converts to this type from the input type.
Source§

impl From<ExprSubscript> for Expr

Source§

fn from(node: ExprSubscript) -> Self

Converts to this type from the input type.
Source§

impl From<ExprTString> for Expr

Source§

fn from(node: ExprTString) -> Self

Converts to this type from the input type.
Source§

impl From<ExprTuple> for Expr

Source§

fn from(node: ExprTuple) -> Self

Converts to this type from the input type.
Source§

impl From<ExprUnaryOp> for Expr

Source§

fn from(node: ExprUnaryOp) -> Self

Converts to this type from the input type.
Source§

impl From<ExprYield> for Expr

Source§

fn from(node: ExprYield) -> Self

Converts to this type from the input type.
Source§

impl From<ExprYieldFrom> for Expr

Source§

fn from(node: ExprYieldFrom) -> Self

Converts to this type from the input type.
Source§

impl From<FString> for Expr

Source§

fn from(payload: FString) -> Self

Converts to this type from the input type.
Source§

impl From<StringLiteral> for Expr

Source§

fn from(payload: StringLiteral) -> Self

Converts to this type from the input type.
Source§

impl From<TString> for Expr

Source§

fn from(payload: TString) -> Self

Converts to this type from the input type.
Source§

impl HasNodeIndex for Expr

Source§

fn node_index(&self) -> &AtomicNodeIndex

Returns the AtomicNodeIndex for this node.
Source§

impl PartialEq for Expr

Source§

fn eq(&self, other: &Expr) -> 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 Ranged for Expr

Source§

fn range(&self) -> TextRange

The range of this item in the source text.
Source§

fn start(&self) -> TextSize

The start offset of this item in the source text.
Source§

fn end(&self) -> TextSize

The end offset of this item in the source text.
Source§

impl<'a> TryFrom<&'a Expr> for StringLike<'a>

Source§

type Error = ()

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

fn try_from(value: &'a Expr) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Expr

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Expr, ()>

Performs the conversion.
Source§

impl StructuralPartialEq for Expr

Auto Trait Implementations§

§

impl !Freeze for Expr

§

impl RefUnwindSafe for Expr

§

impl Send for Expr

§

impl Sync for Expr

§

impl Unpin for Expr

§

impl UnsafeUnpin for Expr

§

impl UnwindSafe 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> 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> 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> 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 = 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.