> ## 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::traits::Into

A value-to-value conversion that consumes the input value.
Note: This trait must not fail. If the conversion can fail, use [`TryInto`](./core-traits-TryInto).

## Signature

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

# Generic Implementations

* [`Into`](./core-traits-Into) is reflexive, which means that `Into` is implemented

## Examples

Converting from RGB components to a packed color value:

```rust theme={null}
#[derive(Copy, Drop, PartialEq)]
struct Color {
    // Packed as 0x00RRGGBB
    value: u32,
}

impl RGBIntoColor of Into {
    fn into(self: (u8, u8, u8)) -> Color {
        let (r, g, b) = self;
        let value = (r.into() * 0x10000_u32) +
                   (g.into() * 0x100_u32) +
                   b.into();
        Color { value }
    }
}

// Convert RGB(255, 128, 0) to 0x00FF8000
let orange: Color = (255_u8, 128_u8, 0_u8).into();
assert!(orange == Color { value: 0x00FF8000_u32 });
```

## Trait functions

### into

Converts the input type T into the output type S.

#### Signature

```rust theme={null}
fn into(self: T) -> S
```

#### Examples

```rust theme={null}
let a: u8 = 1;
let b: u16 = a.into();
```
