rune::alloc::prelude

Trait TryClone

Source
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§

Source

fn try_clone(&self) -> Result<Self, Error>

Try to clone the current value, raising an allocation error if it’s unsuccessful.

Provided Methods§

Source

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 bool

Source§

impl TryClone for char

Source§

impl TryClone for f32

Source§

impl TryClone for f64

Source§

impl TryClone for i8

Source§

impl TryClone for i16

Source§

impl TryClone for i32

Source§

impl TryClone for i64

Source§

impl TryClone for i128

Source§

impl TryClone for isize

Source§

impl TryClone for u8

Source§

impl TryClone for u16

Source§

impl TryClone for u32

Source§

impl TryClone for u64

Source§

impl TryClone for u128

Source§

impl TryClone for ()

Source§

impl TryClone for usize

Source§

impl TryClone for String

Source§

impl TryClone for NonZero<i8>

Source§

impl TryClone for NonZero<i16>

Source§

impl TryClone for NonZero<i32>

Source§

impl TryClone for NonZero<i64>

Source§

impl TryClone for NonZero<i128>

Source§

impl TryClone for NonZero<isize>

Source§

impl TryClone for NonZero<u8>

Source§

impl TryClone for NonZero<u16>

Source§

impl TryClone for NonZero<u32>

Source§

impl TryClone for NonZero<u64>

Source§

impl TryClone for NonZero<u128>

Source§

impl TryClone for NonZero<usize>

Source§

impl TryClone for ExitStatus

Source§

impl<A> TryClone for (A,)
where A: TryClone,

Source§

impl<A, B> TryClone for (A, B)
where A: TryClone, B: TryClone,

Source§

impl<A, B, C> TryClone for (A, B, C)
where A: TryClone, B: TryClone, C: TryClone,

Source§

impl<A, B, C, D> TryClone for (A, B, C, D)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone,

Source§

impl<A, B, C, D, E> TryClone for (A, B, C, D, E)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone,

Source§

impl<A, B, C, D, E, F> TryClone for (A, B, C, D, E, F)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone,

Source§

impl<A, B, C, D, E, F, G> TryClone for (A, B, C, D, E, F, G)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone,

Source§

impl<A, B, C, D, E, F, G, H> TryClone for (A, B, C, D, E, F, G, H)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone,

Source§

impl<A, B, C, D, E, F, G, H, I> TryClone for (A, B, C, D, E, F, G, H, I)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone,

Source§

impl<A, B, C, D, E, F, G, H, I, J> TryClone for (A, B, C, D, E, F, G, H, I, J)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone,

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)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone, K: TryClone,

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)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone, K: TryClone, L: TryClone,

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)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone, K: TryClone, L: TryClone, M: TryClone,

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)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone, K: TryClone, L: TryClone, M: TryClone, N: TryClone,

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)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone, K: TryClone, L: TryClone, M: TryClone, N: TryClone, O: TryClone,

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)

Source§

impl<T> TryClone for Option<T>
where T: TryClone,

Source§

impl<T> TryClone for &T
where T: ?Sized,

Source§

impl<T> TryClone for Box<[T]>
where T: TryClone,

Source§

impl<T> TryClone for Box<T>
where T: TryClone,

Source§

fn try_clone(&self) -> Result<Box<T>, Error>

Source§

impl<T> TryClone for Rc<T>
where T: ?Sized,

Source§

fn try_clone(&self) -> Result<Rc<T>, Error>

Source§

impl<T> TryClone for Arc<T>
where T: ?Sized,

Source§

fn try_clone(&self) -> Result<Arc<T>, Error>

Source§

impl<T, E> TryClone for Result<T, E>
where T: TryClone, E: TryClone,

Source§

fn try_clone(&self) -> Result<Result<T, E>, Error>

Implementors§

Source§

impl TryClone for AttrStyle

Source§

impl TryClone for BinOp

Source§

impl TryClone for BuiltIn

Source§

impl TryClone for Condition

Source§

impl TryClone for Delimiter

Source§

impl TryClone for Expr

Source§

impl TryClone for ExprClosureArgs

Source§

impl TryClone for ExprField

Source§

impl TryClone for ExprRangeLimits

Source§

impl TryClone for ExprSelectBranch

Source§

impl TryClone for rune::ast::Fields

Source§

impl TryClone for FnArg

Source§

impl TryClone for Item

Source§

impl TryClone for ItemModBody

Source§

impl TryClone for ItemOrExpr

Source§

impl TryClone for ItemUseSegment

Source§

impl TryClone for rune::ast::Kind

Source§

impl TryClone for Lit

Source§

impl TryClone for LitSource

Source§

impl TryClone for NumberBase

Source§

impl TryClone for NumberSize

Source§

impl TryClone for NumberSource

Source§

impl TryClone for NumberSuffix

Source§

impl TryClone for NumberValue

Source§

impl TryClone for ObjectIdent

Source§

impl TryClone for ObjectKey

Source§

impl TryClone for Pat

Source§

impl TryClone for PathSegment

Source§

impl TryClone for Stmt

Source§

impl TryClone for StmtSortKey

Source§

impl TryClone for StrSource

Source§

impl TryClone for UnOp

Source§

impl TryClone for Visibility

Source§

impl TryClone for AssociatedKind

Source§

impl TryClone for rune::compile::meta::Fields

Source§

impl TryClone for rune::compile::meta::Kind

Source§

impl TryClone for Component

Source§

impl TryClone for DebugArgs

Source§

impl TryClone for Call

Source§

impl TryClone for ControlFlow

Source§

impl TryClone for GeneratorState

Source§

impl TryClone for Inst

Source§

impl TryClone for InstArithmeticOp

Source§

impl TryClone for InstBitwiseOp

Source§

impl TryClone for InstOp

Source§

impl TryClone for InstRange

Source§

impl TryClone for InstShiftOp

Source§

impl TryClone for InstTarget

Source§

impl TryClone for InstValue

Source§

impl TryClone for InstVariant

Source§

impl TryClone for PanicReason

Source§

impl TryClone for TypeCheck

Source§

impl TryClone for Alignment

Source§

impl TryClone for Cow<'_, str>

Source§

impl TryClone for Abstract

Source§

impl TryClone for AlignOf

Source§

impl TryClone for Amp

Source§

impl TryClone for AmpAmp

Source§

impl TryClone for AmpEq

Source§

impl TryClone for Arrow

Source§

impl TryClone for As

Source§

impl TryClone for Async

Source§

impl TryClone for At

Source§

impl TryClone for Attribute

Source§

impl TryClone for Await

Source§

impl TryClone for Bang

Source§

impl TryClone for BangEq

Source§

impl TryClone for Become

Source§

impl TryClone for Block

Source§

impl TryClone for Break

Source§

impl TryClone for ByteIndex

Source§

impl TryClone for Caret

Source§

impl TryClone for CaretEq

Source§

impl TryClone for CloseBrace

Source§

impl TryClone for CloseBracket

Source§

impl TryClone for CloseEmpty

Source§

impl TryClone for CloseParen

Source§

impl TryClone for Colon

Source§

impl TryClone for ColonColon

Source§

impl TryClone for Comma

Source§

impl TryClone for Const

Source§

impl TryClone for Continue

Source§

impl TryClone for Crate

Source§

impl TryClone for Dash

Source§

impl TryClone for DashEq

Source§

impl TryClone for Default

Source§

impl TryClone for Div

Source§

impl TryClone for Do

Source§

impl TryClone for Dollar

Source§

impl TryClone for Dot

Source§

impl TryClone for DotDot

Source§

impl TryClone for DotDotEq

Source§

impl TryClone for Else

Source§

impl TryClone for EmptyBlock

Source§

impl TryClone for Enum

Source§

impl TryClone for Eq

Source§

impl TryClone for EqEq

Source§

impl TryClone for ExprAssign

Source§

impl TryClone for ExprAwait

Source§

impl TryClone for ExprBinary

Source§

impl TryClone for ExprBlock

Source§

impl TryClone for ExprBreak

Source§

impl TryClone for ExprCall

Source§

impl TryClone for ExprClosure

Source§

impl TryClone for ExprContinue

Source§

impl TryClone for ExprDefaultBranch

Source§

impl TryClone for ExprElse

Source§

impl TryClone for ExprElseIf

Source§

impl TryClone for ExprEmpty

Source§

impl TryClone for ExprFieldAccess

Source§

impl TryClone for ExprFor

Source§

impl TryClone for ExprGroup

Source§

impl TryClone for ExprIf

Source§

impl TryClone for ExprIndex

Source§

impl TryClone for ExprLet

Source§

impl TryClone for ExprLit

Source§

impl TryClone for ExprLoop

Source§

impl TryClone for ExprMatch

Source§

impl TryClone for ExprMatchBranch

Source§

impl TryClone for ExprObject

Source§

impl TryClone for ExprRange

Source§

impl TryClone for ExprReturn

Source§

impl TryClone for ExprSelect

Source§

impl TryClone for ExprSelectPatBranch

Source§

impl TryClone for ExprTry

Source§

impl TryClone for ExprTuple

Source§

impl TryClone for ExprUnary

Source§

impl TryClone for ExprVec

Source§

impl TryClone for ExprWhile

Source§

impl TryClone for ExprYield

Source§

impl TryClone for Extern

Source§

impl TryClone for False

Source§

impl TryClone for Field

Source§

impl TryClone for FieldAssign

Source§

impl TryClone for File

Source§

impl TryClone for Final

Source§

impl TryClone for Fn

Source§

impl TryClone for For

Source§

impl TryClone for Group

Source§

impl TryClone for Gt

Source§

impl TryClone for GtEq

Source§

impl TryClone for GtGt

Source§

impl TryClone for GtGtEq

Source§

impl TryClone for Ident

Source§

impl TryClone for If

Source§

impl TryClone for Impl

Source§

impl TryClone for In

Source§

impl TryClone for Is

Source§

impl TryClone for IsNot

Source§

impl TryClone for ItemConst

Source§

impl TryClone for ItemEnum

Source§

impl TryClone for ItemFn

Source§

impl TryClone for ItemImpl

Source§

impl TryClone for ItemInlineBody

Source§

impl TryClone for ItemMod

Source§

impl TryClone for ItemStruct

Source§

impl TryClone for ItemUse

Source§

impl TryClone for ItemUsePath

Source§

impl TryClone for ItemVariant

Source§

impl TryClone for Label

Source§

impl TryClone for Let

Source§

impl TryClone for LitBool

Source§

impl TryClone for LitByte

Source§

impl TryClone for LitByteStr

Source§

impl TryClone for LitChar

Source§

impl TryClone for LitNumber

Source§

impl TryClone for LitStr

Source§

impl TryClone for Local

Source§

impl TryClone for Loop

Source§

impl TryClone for Lt

Source§

impl TryClone for LtEq

Source§

impl TryClone for LtLt

Source§

impl TryClone for LtLtEq

Source§

impl TryClone for Macro

Source§

impl TryClone for MacroCall

Source§

impl TryClone for Match

Source§

impl TryClone for Mod

Source§

impl TryClone for Move

Source§

impl TryClone for Mut

Source§

impl TryClone for Not

Source§

impl TryClone for Number

Source§

impl TryClone for NumberText

Source§

impl TryClone for OffsetOf

Source§

impl TryClone for OpenBrace

Source§

impl TryClone for OpenBracket

Source§

impl TryClone for OpenEmpty

Source§

impl TryClone for OpenParen

Source§

impl TryClone for Override

Source§

impl TryClone for PatBinding

Source§

impl TryClone for PatIgnore

Source§

impl TryClone for PatLit

Source§

impl TryClone for PatObject

Source§

impl TryClone for PatPath

Source§

impl TryClone for PatRest

Source§

impl TryClone for PatTuple

Source§

impl TryClone for PatVec

Source§

impl TryClone for Path

Source§

impl TryClone for PathSegmentExpr

Source§

impl TryClone for Perc

Source§

impl TryClone for PercEq

Source§

impl TryClone for Pipe

Source§

impl TryClone for PipeEq

Source§

impl TryClone for PipePipe

Source§

impl TryClone for Plus

Source§

impl TryClone for PlusEq

Source§

impl TryClone for Pound

Source§

impl TryClone for Priv

Source§

impl TryClone for Proc

Source§

impl TryClone for Pub

Source§

impl TryClone for Pure

Source§

impl TryClone for QuestionMark

Source§

impl TryClone for Ref

Source§

impl TryClone for Return

Source§

impl TryClone for Rocket

Source§

impl TryClone for Select

Source§

impl TryClone for SelfType

Source§

impl TryClone for SelfValue

Source§

impl TryClone for SemiColon

Source§

impl TryClone for Shebang

Source§

impl TryClone for SizeOf

Source§

impl TryClone for SlashEq

Source§

impl TryClone for Span

Source§

impl TryClone for Star

Source§

impl TryClone for StarEq

Source§

impl TryClone for Static

Source§

impl TryClone for StmtSemi

Source§

impl TryClone for StrText

Source§

impl TryClone for Struct

Source§

impl TryClone for Super

Source§

impl TryClone for Tilde

Source§

impl TryClone for Token

Source§

impl TryClone for True

Source§

impl TryClone for TypeOf

Source§

impl TryClone for Underscore

Source§

impl TryClone for Unsafe

Source§

impl TryClone for Use

Source§

impl TryClone for Virtual

Source§

impl TryClone for While

Source§

impl TryClone for Yield

Source§

impl TryClone for Alias

Source§

impl TryClone for DocType

Source§

impl TryClone for FieldMeta

Source§

impl TryClone for FieldsNamed

Source§

impl TryClone for Import

Source§

impl TryClone for Signature

Source§

impl TryClone for SourceMeta

Source§

impl TryClone for ImportStep

Source§

impl TryClone for ItemId

Source§

impl TryClone for Location

Source§

impl TryClone for SyntheticId

Source§

impl TryClone for TokenStream

Source§

impl TryClone for DebugInfo

Source§

impl TryClone for DebugInst

Source§

impl TryClone for DebugSignature

Source§

impl TryClone for Flags

Source§

impl TryClone for Format

Source§

impl TryClone for FormatSpec

Source§

impl TryClone for AnyTypeInfo

Source§

impl TryClone for Bytes

Source§

impl TryClone for CallFrame

Source§

impl TryClone for ConstValue

Source§

impl TryClone for DebugLabel

Source§

impl TryClone for Function

Source§

impl TryClone for InstAddress

Source§

impl TryClone for Object

Source§

impl TryClone for Output

Source§

impl TryClone for OwnedTuple

Source§

impl TryClone for Range

Source§

impl TryClone for RangeFrom

Source§

impl TryClone for RangeFull

Source§

impl TryClone for RangeInclusive

Source§

impl TryClone for RangeTo

Source§

impl TryClone for RangeToInclusive

Source§

impl TryClone for RuntimeContext

Source§

impl TryClone for Stack

Source§

impl TryClone for SyncFunction

Source§

impl TryClone for TypeInfo

Source§

impl TryClone for Value

Source§

impl TryClone for rune::runtime::Vec

Source§

impl TryClone for Vm

Source§

impl TryClone for ArrayUnit

Source§

impl TryClone for ByteCodeUnit

Source§

impl TryClone for Hash

Source§

impl TryClone for Source

Source§

impl TryClone for SourceId

Source§

impl TryClone for Found

Available on crate feature workspace only.
Source§

impl TryClone for PathBuf

Source§

impl<'a> TryClone for PathKind<'a>

Source§

impl<'a> TryClone for MetaRef<'a>

Source§

impl<'a> TryClone for FoundPackage<'a>

Available on crate feature workspace only.
Source§

impl<A> TryClone for ItemBuf<A>
where A: Allocator + Clone,

Source§

impl<A> TryClone for rune::alloc::Box<str, A>
where A: Allocator + Clone,

Source§

impl<A> TryClone for rune::alloc::Box<Path, A>
where A: Allocator + Clone,

Source§

impl<A> TryClone for rune::alloc::String<A>
where A: Allocator + Clone,

Source§

impl<K, V, A> TryClone for BTreeMap<K, V, A>
where K: TryClone, V: TryClone, A: Allocator + Clone,

Source§

impl<K, V, S, A> TryClone for HashMap<K, V, S, A>
where K: TryClone, V: TryClone, S: Clone, A: Allocator + Clone,

Source§

impl<S> TryClone for Logic<S>
where S: TryClone,

Source§

impl<S> TryClone for Unit<S>
where S: TryClone,

Source§

impl<T> TryClone for CopySource<T>
where T: Copy + TryClone,

Source§

impl<T> TryClone for EqValue<T>
where T: TryClone,

Source§

impl<T> TryClone for Generator<T>
where T: TryClone + AsRef<Vm> + AsMut<Vm>,

Source§

impl<T> TryClone for Stream<T>
where T: TryClone + AsRef<Vm> + AsMut<Vm>,

Source§

impl<T> TryClone for VmExecution<T>
where T: AsRef<Vm> + AsMut<Vm> + TryClone,

Source§

impl<T, A> TryClone for RawTable<T, A>
where A: Allocator + Clone, T: TryClone,

Source§

impl<T, A> TryClone for BTreeSet<T, A>
where A: Allocator + Clone, T: TryClone,

Source§

impl<T, A> TryClone for rune::alloc::Box<[T], A>
where A: Allocator + Clone, T: TryClone,

Source§

impl<T, A> TryClone for rune::alloc::Box<T, A>
where A: Allocator + Clone, T: TryClone,

Source§

impl<T, A> TryClone for rune::alloc::Vec<T, A>
where A: Allocator + Clone, T: TryClone,

Source§

impl<T, A> TryClone for VecDeque<T, A>
where T: TryClone, A: Allocator + Clone,

Source§

impl<T, A> TryClone for IntoIter<T, A>
where A: Allocator + Clone, T: TryClone,

Source§

impl<T, S> TryClone for AngleBracketed<T, S>
where T: TryClone, S: TryClone,

Source§

impl<T, S> TryClone for Braced<T, S>
where T: TryClone, S: TryClone,

Source§

impl<T, S> TryClone for Bracketed<T, S>
where T: TryClone, S: TryClone,

Source§

impl<T, S> TryClone for Parenthesized<T, S>
where T: TryClone, S: TryClone,

Source§

impl<T, S, A> TryClone for HashSet<T, S, A>
where A: Allocator + Clone, T: TryClone, S: Clone,