pub trait TryClone: Sized {
// Required method
fn try_clone(&self) -> Result<Self, Error>;
// Provided method
fn try_clone_from(&mut self, source: &Self) -> Result<(), Error> { ... }
}
Expand description
Fallible TryClone
trait.
Required Methods§
Provided Methods§
Sourcefn try_clone_from(&mut self, source: &Self) -> Result<(), Error>
fn try_clone_from(&mut self, source: &Self) -> Result<(), Error>
Performs copy-assignment from source
.
a.try_clone_from(&b)
is equivalent to a = b.clone()
in
functionality, but can be overridden to reuse the resources of a
to
avoid unnecessary allocations.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl TryClone for ExitStatus
impl TryClone for ExitStatus
Source§impl<A, B, C, D> TryClone for (A, B, C, D)
impl<A, B, C, D> TryClone for (A, B, C, D)
Source§impl<A, B, C, D, E> TryClone for (A, B, C, D, E)
impl<A, B, C, D, E> TryClone for (A, B, C, D, E)
Source§impl<A, B, C, D, E, F> TryClone for (A, B, C, D, E, F)
impl<A, B, C, D, E, F> TryClone for (A, B, C, D, E, F)
Source§impl<A, B, C, D, E, F, G> TryClone for (A, B, C, D, E, F, G)
impl<A, B, C, D, E, F, G> TryClone for (A, B, C, D, E, F, G)
Source§impl<A, B, C, D, E, F, G, H> TryClone for (A, B, C, D, E, F, G, H)
impl<A, B, C, D, E, F, G, H> TryClone for (A, B, C, D, E, F, G, H)
Source§impl<A, B, C, D, E, F, G, H, I> TryClone for (A, B, C, D, E, F, G, H, I)
impl<A, B, C, D, E, F, G, H, I> TryClone for (A, B, C, D, E, F, G, H, I)
Source§impl<A, B, C, D, E, F, G, H, I, J> TryClone for (A, B, C, D, E, F, G, H, I, J)
impl<A, B, C, D, E, F, G, H, I, J> TryClone for (A, B, C, D, E, F, G, H, I, J)
Source§impl<A, B, C, D, E, F, G, H, I, J, K> TryClone for (A, B, C, D, E, F, G, H, I, J, K)
impl<A, B, C, D, E, F, G, H, I, J, K> TryClone for (A, B, C, D, E, F, G, H, I, J, K)
Source§impl<A, B, C, D, E, F, G, H, I, J, K, L> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L)
impl<A, B, C, D, E, F, G, H, I, J, K, L> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L)
Source§impl<A, B, C, D, E, F, G, H, I, J, K, L, M> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M)
impl<A, B, C, D, E, F, G, H, I, J, K, L, M> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M)
Source§impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)
impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)
Source§impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)
impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)
Source§impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)
impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)
Implementors§
impl TryClone for AttrStyle
impl TryClone for BinOp
impl TryClone for BuiltIn
impl TryClone for Condition
impl TryClone for Delimiter
impl TryClone for Expr
impl TryClone for ExprClosureArgs
impl TryClone for ExprField
impl TryClone for ExprRangeLimits
impl TryClone for ExprSelectBranch
impl TryClone for rune::ast::Fields
impl TryClone for FnArg
impl TryClone for Item
impl TryClone for ItemModBody
impl TryClone for ItemOrExpr
impl TryClone for ItemUseSegment
impl TryClone for rune::ast::Kind
impl TryClone for Lit
impl TryClone for LitSource
impl TryClone for NumberBase
impl TryClone for NumberSize
impl TryClone for NumberSource
impl TryClone for NumberSuffix
impl TryClone for NumberValue
impl TryClone for ObjectIdent
impl TryClone for ObjectKey
impl TryClone for Pat
impl TryClone for PathSegment
impl TryClone for Stmt
impl TryClone for StmtSortKey
impl TryClone for StrSource
impl TryClone for UnOp
impl TryClone for Visibility
impl TryClone for AssociatedKind
impl TryClone for rune::compile::meta::Fields
impl TryClone for rune::compile::meta::Kind
impl TryClone for Component
impl TryClone for DebugArgs
impl TryClone for Call
impl TryClone for ControlFlow
impl TryClone for GeneratorState
impl TryClone for Inst
impl TryClone for InstArithmeticOp
impl TryClone for InstBitwiseOp
impl TryClone for InstOp
impl TryClone for InstRange
impl TryClone for InstShiftOp
impl TryClone for InstTarget
impl TryClone for InstValue
impl TryClone for InstVariant
impl TryClone for PanicReason
impl TryClone for TypeCheck
impl TryClone for Alignment
impl TryClone for Cow<'_, str>
impl TryClone for Abstract
impl TryClone for AlignOf
impl TryClone for Amp
impl TryClone for AmpAmp
impl TryClone for AmpEq
impl TryClone for Arrow
impl TryClone for As
impl TryClone for Async
impl TryClone for At
impl TryClone for Attribute
impl TryClone for Await
impl TryClone for Bang
impl TryClone for BangEq
impl TryClone for Become
impl TryClone for Block
impl TryClone for Break
impl TryClone for ByteIndex
impl TryClone for Caret
impl TryClone for CaretEq
impl TryClone for CloseBrace
impl TryClone for CloseBracket
impl TryClone for CloseEmpty
impl TryClone for CloseParen
impl TryClone for Colon
impl TryClone for ColonColon
impl TryClone for Comma
impl TryClone for Const
impl TryClone for Continue
impl TryClone for Crate
impl TryClone for Dash
impl TryClone for DashEq
impl TryClone for Default
impl TryClone for Div
impl TryClone for Do
impl TryClone for Dollar
impl TryClone for Dot
impl TryClone for DotDot
impl TryClone for DotDotEq
impl TryClone for Else
impl TryClone for EmptyBlock
impl TryClone for Enum
impl TryClone for Eq
impl TryClone for EqEq
impl TryClone for ExprAssign
impl TryClone for ExprAwait
impl TryClone for ExprBinary
impl TryClone for ExprBlock
impl TryClone for ExprBreak
impl TryClone for ExprCall
impl TryClone for ExprClosure
impl TryClone for ExprContinue
impl TryClone for ExprDefaultBranch
impl TryClone for ExprElse
impl TryClone for ExprElseIf
impl TryClone for ExprEmpty
impl TryClone for ExprFieldAccess
impl TryClone for ExprFor
impl TryClone for ExprGroup
impl TryClone for ExprIf
impl TryClone for ExprIndex
impl TryClone for ExprLet
impl TryClone for ExprLit
impl TryClone for ExprLoop
impl TryClone for ExprMatch
impl TryClone for ExprMatchBranch
impl TryClone for ExprObject
impl TryClone for ExprRange
impl TryClone for ExprReturn
impl TryClone for ExprSelect
impl TryClone for ExprSelectPatBranch
impl TryClone for ExprTry
impl TryClone for ExprTuple
impl TryClone for ExprUnary
impl TryClone for ExprVec
impl TryClone for ExprWhile
impl TryClone for ExprYield
impl TryClone for Extern
impl TryClone for False
impl TryClone for Field
impl TryClone for FieldAssign
impl TryClone for File
impl TryClone for Final
impl TryClone for Fn
impl TryClone for For
impl TryClone for Group
impl TryClone for Gt
impl TryClone for GtEq
impl TryClone for GtGt
impl TryClone for GtGtEq
impl TryClone for Ident
impl TryClone for If
impl TryClone for Impl
impl TryClone for In
impl TryClone for Is
impl TryClone for IsNot
impl TryClone for ItemConst
impl TryClone for ItemEnum
impl TryClone for ItemFn
impl TryClone for ItemImpl
impl TryClone for ItemInlineBody
impl TryClone for ItemMod
impl TryClone for ItemStruct
impl TryClone for ItemUse
impl TryClone for ItemUsePath
impl TryClone for ItemVariant
impl TryClone for Label
impl TryClone for Let
impl TryClone for LitBool
impl TryClone for LitByte
impl TryClone for LitByteStr
impl TryClone for LitChar
impl TryClone for LitNumber
impl TryClone for LitStr
impl TryClone for Local
impl TryClone for Loop
impl TryClone for Lt
impl TryClone for LtEq
impl TryClone for LtLt
impl TryClone for LtLtEq
impl TryClone for Macro
impl TryClone for MacroCall
impl TryClone for Match
impl TryClone for Mod
impl TryClone for Move
impl TryClone for Mut
impl TryClone for Not
impl TryClone for Number
impl TryClone for NumberText
impl TryClone for OffsetOf
impl TryClone for OpenBrace
impl TryClone for OpenBracket
impl TryClone for OpenEmpty
impl TryClone for OpenParen
impl TryClone for Override
impl TryClone for PatBinding
impl TryClone for PatIgnore
impl TryClone for PatLit
impl TryClone for PatObject
impl TryClone for PatPath
impl TryClone for PatRest
impl TryClone for PatTuple
impl TryClone for PatVec
impl TryClone for Path
impl TryClone for PathSegmentExpr
impl TryClone for Perc
impl TryClone for PercEq
impl TryClone for Pipe
impl TryClone for PipeEq
impl TryClone for PipePipe
impl TryClone for Plus
impl TryClone for PlusEq
impl TryClone for Pound
impl TryClone for Priv
impl TryClone for Proc
impl TryClone for Pub
impl TryClone for Pure
impl TryClone for QuestionMark
impl TryClone for Ref
impl TryClone for Return
impl TryClone for Rocket
impl TryClone for Select
impl TryClone for SelfType
impl TryClone for SelfValue
impl TryClone for SemiColon
impl TryClone for Shebang
impl TryClone for SizeOf
impl TryClone for SlashEq
impl TryClone for Span
impl TryClone for Star
impl TryClone for StarEq
impl TryClone for Static
impl TryClone for StmtSemi
impl TryClone for StrText
impl TryClone for Struct
impl TryClone for Super
impl TryClone for Tilde
impl TryClone for Token
impl TryClone for True
impl TryClone for TypeOf
impl TryClone for Underscore
impl TryClone for Unsafe
impl TryClone for Use
impl TryClone for Virtual
impl TryClone for While
impl TryClone for Yield
impl TryClone for Alias
impl TryClone for DocType
impl TryClone for FieldMeta
impl TryClone for FieldsNamed
impl TryClone for Import
impl TryClone for Signature
impl TryClone for SourceMeta
impl TryClone for ImportStep
impl TryClone for ItemId
impl TryClone for Location
impl TryClone for SyntheticId
impl TryClone for TokenStream
impl TryClone for DebugInfo
impl TryClone for DebugInst
impl TryClone for DebugSignature
impl TryClone for Flags
impl TryClone for Format
impl TryClone for FormatSpec
impl TryClone for AnyTypeInfo
impl TryClone for Bytes
impl TryClone for CallFrame
impl TryClone for ConstValue
impl TryClone for DebugLabel
impl TryClone for Function
impl TryClone for InstAddress
impl TryClone for Object
impl TryClone for Output
impl TryClone for OwnedTuple
impl TryClone for Range
impl TryClone for RangeFrom
impl TryClone for RangeFull
impl TryClone for RangeInclusive
impl TryClone for RangeTo
impl TryClone for RangeToInclusive
impl TryClone for RuntimeContext
impl TryClone for Stack
impl TryClone for SyncFunction
impl TryClone for TypeInfo
impl TryClone for Value
impl TryClone for rune::runtime::Vec
impl TryClone for Vm
impl TryClone for ArrayUnit
impl TryClone for ByteCodeUnit
impl TryClone for Hash
impl TryClone for Source
impl TryClone for SourceId
impl TryClone for Found
Available on crate feature
workspace
only.impl TryClone for PathBuf
impl<'a> TryClone for PathKind<'a>
impl<'a> TryClone for MetaRef<'a>
impl<'a> TryClone for FoundPackage<'a>
Available on crate feature
workspace
only.