pub struct ComparisonViewportGrid {
pub grid_version: String,
pub source_frequency: String,
pub requested_view_start_time: Option<Timestamp>,
pub requested_view_end_time: Option<Timestamp>,
pub viewport_width_px: i32,
pub bucket_size_bars: i64,
pub source_point_count: i64,
pub view_source_point_count: i64,
pub returned_bucket_count: i64,
}Expand description
Metadata for the deterministic, UTC-anchored comparison_grid_v1 contract.
Implementations clamp viewport_width_px to 64..8192 and then round it up to a 128px step. They calculate the number of canonical source-frequency slots intersecting the half-open requested viewport, divide that count by the normalized width, and round the result up to the next positive power of two. That value is bucket_size_bars. Bucket zero is anchored at the Unix epoch; display_time is the canonical timestamp of the final source Bar slot in the bucket. See comparison_grid_v1_test_vectors.json for conformance cases.
Fields§
§grid_version: String§source_frequency: String§requested_view_start_time: Option<Timestamp>§requested_view_end_time: Option<Timestamp>§viewport_width_px: i32§bucket_size_bars: i64§source_point_count: i64§view_source_point_count: i64§returned_bucket_count: i64Trait Implementations§
Source§impl Clone for ComparisonViewportGrid
impl Clone for ComparisonViewportGrid
Source§fn clone(&self) -> ComparisonViewportGrid
fn clone(&self) -> ComparisonViewportGrid
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComparisonViewportGrid
impl Debug for ComparisonViewportGrid
Source§impl Default for ComparisonViewportGrid
impl Default for ComparisonViewportGrid
Source§impl Message for ComparisonViewportGrid
impl Message for ComparisonViewportGrid
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for ComparisonViewportGrid
impl PartialEq for ComparisonViewportGrid
impl StructuralPartialEq for ComparisonViewportGrid
Auto Trait Implementations§
impl Freeze for ComparisonViewportGrid
impl RefUnwindSafe for ComparisonViewportGrid
impl Send for ComparisonViewportGrid
impl Sync for ComparisonViewportGrid
impl Unpin for ComparisonViewportGrid
impl UnsafeUnpin for ComparisonViewportGrid
impl UnwindSafe for ComparisonViewportGrid
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request