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>
impl<'a, const N: usize> Profile<'a, N>
Sourcepub fn new(
id: &'a str,
channel: Channel<'a>,
period: Period,
first_utc: i64,
) -> Result<Profile<'a, N>, Error>
pub fn new( id: &'a str, channel: Channel<'a>, period: Period, first_utc: i64, ) -> Result<Profile<'a, N>, Error>
The first reference timestamp defines the phase of the meter’s grid.
pub fn profile_id(&self) -> &'a str
pub fn channel(&self) -> Channel<'a>
Sourcepub fn window(&self) -> RangeInclusive<i64> ⓘ
pub fn window(&self) -> RangeInclusive<i64> ⓘ
Inclusive UTC bounds of the commissioned registration window.
Sourcepub fn capture_batch<T, E>(
&mut self,
capture: impl FnOnce(&mut CaptureBatch<'_, '_, N>) -> Result<T, E>,
) -> Result<T, E>
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.
Sourcepub fn capture(
&mut self,
channel: Channel<'_>,
record: Record,
) -> Result<Capture, Error>
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.
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> 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