> ## Documentation Index
> Fetch the complete documentation index at: https://docs.starknet.io/llms.txt
> Use this file to discover all available pages before exploring further.

# core::clone::Clone

A common trait for the ability to explicitly duplicate an object.
Differs from `Copy` in that `Copy` is implicit and inexpensive, while
`Clone` is always explicit and may or may not be expensive.
Since `Clone` is more general than `Copy`, you can automatically make anything
`Copy` be `Clone` as well.

## Signature

```rust theme={null}
pub trait Clone
```

## Derivable

This trait can be used with `#[derive]` if all fields are `Clone`. The `derive`d
implementation of `Clone` calls `clone` on each field.

## Trait functions

### clone

Returns a copy of the value.

#### Signature

```rust theme={null}
fn clone(self: @T) -> T
```

#### Examples

```rust theme={null}
let arr = array![1, 2, 3];
assert!(arr == arr.clone());
```
