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> !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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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