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

# Struct ScheduledValueChange

Module: `noir_aztec::protocol::delayed_public_mutable::scheduled_value_change`

```rust
pub struct ScheduledValueChange<T>
{ /* private fields */ }
```

## Implementations

```rust
impl<T> ScheduledValueChange<T>
```

```rust
pub fn new(pre: T, post: T, timestamp_of_change: u64) -> Self
```

```rust
pub fn get_current_at(self, timestamp: u64) -> T
```

Returns the value stored in the data structure at a given timestamp. This function can be called both in public (where `timestamp` is simply the current timestamp, i.e. the timestamp at which the current transaction will be included) and in private (where `timestamp` is the anchor block's timestamp). Reading in private is only safe if the transaction's `expiration_timestamp` property is set to a value lower or equal to the time horizon (see `get_time_horizon()`).

```rust
pub fn get_scheduled(self) -> (T, u64)
```

Returns the scheduled change, i.e. the post-change value and the timestamp at which it will become the current value. Note that this timestamp may be in the past if the change has already taken place. Additionally, further changes might be later scheduled, potentially canceling the one returned by this function.

```rust
pub fn get_previous(self) -> (T, u64)
```

```rust
pub fn get_time_horizon(self, anchor_block_timestamp: u64, minimum_delay: u64) -> u64
where
    T: Eq
```

Returns the largest timestamp at which the value returned by `get_current_at` is known to remain the current value. This value is only meaningful in private where the proof is constructed against an anchor block, since due to its asynchronous nature private execution cannot know about any later scheduled changes. The caller of this function must know how quickly the value can change due to a scheduled change in the form of `minimum_delay`. If the delay itself is immutable, then this is just its duration. If the delay is mutable however, then this value is the 'effective minimum delay' (obtained by calling `ScheduledDelayChange.get_effective_minimum_delay_at`), which equals the minimum time in seconds that needs to elapse from the next block's timestamp until the value changes, regardless of further delay changes. The value returned by `get_current_at` in private when called with a anchor block's timestamp is only safe to use if the transaction's `expiration_timestamp` property is set to a value lower or equal to the time horizon computed using the same anchor timestamp.

```rust
pub fn schedule_change(
    &mut self,
    new_value: T,
    current_timestamp: u64,
    minimum_delay: u64,
    timestamp_of_change: u64,
)
```

Mutates the value by scheduling a change at the current timestamp. This function is only meaningful when called in public with the current timestamp.

## Trait implementations

```rust
impl<T> Empty for ScheduledValueChange<T>
where
    T: Empty
```

```rust
pub fn empty() -> Self
```

```rust
pub fn is_empty(self: Self) -> bool
where
    Self: Eq
```

```rust
pub fn assert_empty<let S: u32>(self: Self, msg: str<S>)
where
    Self: Eq
```

```rust
impl<T> Eq for ScheduledValueChange<T>
where
    T: Eq
```

```rust
pub fn eq(self, other: Self) -> bool
```
