> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Struct Owned

Module: `noir_aztec::state_vars`

```rust
pub struct Owned<V, Context> {
    pub context: Context,
    /* private fields */
}
```

Per-account state variable.

A wrapper state variable that is to be used with variables that implement the `OwnedStateVariable` trait.

Example usage:

```rust
#[storage]
struct Storage {
    balance: Owned<PrivateSet<UintNote, Context>, Context>,
}
```

To access the underlying owned state variable for a specific owner, use the `at` method:

```rust
let user_balance = storage.balance.at(user_address);
```

For more information on ownership, see the documentation for the `OwnedStateVariable` trait.

## Type Parameters

- `V` - The underlying type that implements `OwnedStateVariable<Context>` (e.g., `PrivateSet`, `PrivateMutable`).
- `Context` - The execution context type (e.g., `PublicContext`, `PrivateContext`, `UtilityContext`). The context determines which methods of the state variable are available.

## Fields

```rust
context: Context
```

## Implementations

```rust
impl<V, Context> Owned<V, Context>
```

```rust
pub fn at(self, owner: AztecAddress) -> V
where
    V: OwnedStateVariable<Context>
```

Returns an instance of the underlying owned state variable for a given owner.

## Trait implementations

```rust
impl<Context, V> StateVariable<1, Context> for Owned<V, Context>
```

```rust
pub fn new(context: Context, storage_slot: Field) -> Self
```

```rust
pub fn get_storage_slot(self) -> Field
```
