Struct switchboard_solana::oracle_program::accounts::history_buffer::AggregatorHistoryBuffer
source · pub struct AggregatorHistoryBuffer<'a> {
pub insertion_idx: usize,
pub rows: Ref<'a, [AggregatorHistoryRow]>,
}
Fields§
§insertion_idx: usize
The current index of the round robin buffer.
rows: Ref<'a, [AggregatorHistoryRow]>
The array of samples collected from the aggregator.
Implementations§
source§impl<'a> AggregatorHistoryBuffer<'a>
impl<'a> AggregatorHistoryBuffer<'a>
sourcepub fn new(
history_buffer: &'a AccountInfo<'_>
) -> Result<AggregatorHistoryBuffer<'a>>
pub fn new( history_buffer: &'a AccountInfo<'_> ) -> Result<AggregatorHistoryBuffer<'a>>
Returns the deserialized Switchboard history buffer account
§Arguments
history_buffer
- A Solana AccountInfo referencing an existing Switchboard history buffer account
sourcepub fn lower_bound(&self, timestamp: i64) -> Option<AggregatorHistoryRow>
pub fn lower_bound(&self, timestamp: i64) -> Option<AggregatorHistoryRow>
Return the previous row in the history buffer for a given timestamp
§Arguments
timestamp
- A unix timestamp to search in the history buffer
Trait Implementations§
source§impl<'a> Discriminator for AggregatorHistoryBuffer<'a>
impl<'a> Discriminator for AggregatorHistoryBuffer<'a>
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
Auto Trait Implementations§
impl<'a> Freeze for AggregatorHistoryBuffer<'a>
impl<'a> !RefUnwindSafe for AggregatorHistoryBuffer<'a>
impl<'a> !Send for AggregatorHistoryBuffer<'a>
impl<'a> !Sync for AggregatorHistoryBuffer<'a>
impl<'a> Unpin for AggregatorHistoryBuffer<'a>
impl<'a> !UnwindSafe for AggregatorHistoryBuffer<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more