Skip to main content

Profile

Struct Profile 

Source
pub struct Profile<'a, const N: usize> { /* private fields */ }
Expand description

A single-channel registered value list. The host owns meter authentication, persistence and recipient authorization.

Implementations§

Source§

impl<'a, const N: usize> Profile<'a, N>

Source

pub fn new( id: &'a str, channel: Channel<'a>, period: Period, first_utc: i64, ) -> Result<Self, Error>

The first reference timestamp defines the phase of the meter’s grid.

Source

pub fn profile_id(&self) -> &'a str

Source

pub fn channel(&self) -> Channel<'a>

Source

pub fn window(&self) -> RangeInclusive<i64> ⓘ

Inclusive UTC bounds of the commissioned registration window.

Source

pub fn period(&self) -> Period

Commissioned interval between two registration instants.

Source

pub fn capture_batch<T, E>( &mut self, capture: impl FnOnce(&mut CaptureBatch<'_, '_, N>) -> Result<T, E>, ) -> Result<T, E>

Commit all insertions when the callback returns Ok. An error or unwinding panic restores the original contents. Bookkeeping takes one boolean per slot.

Source

pub fn capture( &mut self, channel: Channel<'_>, record: Record, ) -> Result<Capture, Error>

Insert the first record for this slot. A conflicting replay leaves it intact.

Source

pub fn records(&self) -> impl Iterator<Item = &Record>

Iterate in reference-time order, including late backfills.

Source

pub fn missing(&self) -> impl Iterator<Item = i64> + '_

Reference instants to request from the meter on a subsequent read.

Auto Trait Implementations§

§

impl<'a, const N: usize> Freeze for Profile<'a, N>

§

impl<'a, const N: usize> RefUnwindSafe for Profile<'a, N>

§

impl<'a, const N: usize> Send for Profile<'a, N>

§

impl<'a, const N: usize> Sync for Profile<'a, N>

§

impl<'a, const N: usize> Unpin for Profile<'a, N>

§

impl<'a, const N: usize> UnsafeUnpin for Profile<'a, N>

§

impl<'a, const N: usize> UnwindSafe for Profile<'a, N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.