pub struct StoreId { /* private fields */ }Expand description
A unique id per store.
The kind of store is part of the id, and can be either a StoreKind::Recording or a
StoreKind::Blueprint.
§Uniqueness
All data associated with a given StoreId, regardless of its source, is considered to belong
to the same logical recording. As such, when ingested in the viewer, they will be pooled into
a single store and displayed as a single, in-viewer recording. This can be very confusing if it
happens inadvertently. However, the ability to pool data sharing the same StoreId can be very
powerful. As a result, we do not want to enforce uniqueness. Still, it is important to
understand what a StoreId is, and, to avoid footguns, default to make them unique.
In the context of the logging SDK, the application id is a mandatory, user-defined string. By default, the recording id is a UUID, which ensures unique-by-default behavior. The user can override the recording id though. In that case, the user is responsible for making the application id/recording id pair unique or not, based on their needs.
In the context of remote recordings (aka a dataset’s segment), the application id is the
dataset entry id, and the recording id is the segment id. The former is a UUID, and the latter
is, by definition, unique within the dataset entry. As a result, the uniqueness of the StoreId
is always guaranteed in this case.
Implementations§
Source§impl StoreId
impl StoreId
pub fn new( kind: StoreKind, application_id: impl Into<ApplicationId>, recording_id: impl Into<RecordingId>, ) -> Self
pub fn recording( application_id: impl Into<ApplicationId>, recording_id: impl Into<RecordingId>, ) -> Self
Sourcepub fn default_blueprint(application_id: ApplicationId) -> Self
pub fn default_blueprint(application_id: ApplicationId) -> Self
Create a Self for the default blueprint of a given application id
Sourcepub fn random(kind: StoreKind, application_id: impl Into<ApplicationId>) -> Self
pub fn random(kind: StoreKind, application_id: impl Into<ApplicationId>) -> Self
Generate a random StoreId with the provided application id.
Note: the application id is required here because fully random store ids are often a logically incorrect thing to build (the notable exceptions being tests).
pub fn empty_recording() -> Self
pub fn with_recording_id(self, recording_id: impl Into<RecordingId>) -> Self
pub fn with_application_id( self, application_id: impl Into<ApplicationId>, ) -> Self
pub fn from_uuid( kind: StoreKind, application_id: ApplicationId, uuid: Uuid, ) -> Self
pub fn is_empty_recording(&self) -> bool
pub fn is_default_blueprint(&self) -> bool
pub fn kind(&self) -> StoreKind
pub fn is_recording(&self) -> bool
pub fn is_blueprint(&self) -> bool
pub fn recording_id(&self) -> &RecordingId
pub fn application_id(&self) -> &ApplicationId
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StoreId
impl<'de> Deserialize<'de> for StoreId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Ord for StoreId
impl Ord for StoreId
Source§impl PartialOrd for StoreId
impl PartialOrd for StoreId
Source§impl SizeBytes for StoreId
impl SizeBytes for StoreId
Source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
self uses on the heap. Read moreSource§fn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
self in bytes, accounting for both stack and heap space.Source§fn stack_size_bytes(&self) -> u64
fn stack_size_bytes(&self) -> u64
self on the stack, in bytes. Read moreimpl Eq for StoreId
impl StructuralPartialEq for StoreId
Auto Trait Implementations§
impl Freeze for StoreId
impl RefUnwindSafe for StoreId
impl Send for StoreId
impl Sync for StoreId
impl Unpin for StoreId
impl UnsafeUnpin for StoreId
impl UnwindSafe for StoreId
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> 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>
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>
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