Struct AuditTag
#[repr(C)]pub struct AuditTag {
pub org_id: u64,
pub engagement_id: u64,
}Expand description
Two-level hierarchy for audit firm workload accounting.
Every K2K MessageEnvelope carries an AuditTag so that GPU work can be
attributed back to a specific engagement — critical for per-engagement
billing and tamper-evident audit trails.
AuditTag::default() returns { org_id: 0, engagement_id: 0 }, denoting
an unspecified / system-level engagement. This is the backward-compatible
default for single-tenant deployments.
§Layout
Pod, Zeroable, AsBytes, FromBytes — safe for direct blit into GPU-shared memory. Rkyv-compatible for zero-copy serialization in message queues.
Fields§
§org_id: u64Audit firm / organization ID.
Stable across all engagements belonging to the same organization.
0 = unspecified (default).
engagement_id: u64Specific engagement / audit project ID.
Distinct per billable unit of work. 0 = unspecified (default).
Implementations§
§impl AuditTag
impl AuditTag
pub const fn unspecified() -> AuditTag
pub const fn unspecified() -> AuditTag
The unspecified / default audit tag ({0, 0}).
Used in single-tenant deployments and as the default for legacy APIs that don’t propagate audit information.
pub const fn is_unspecified(&self) -> bool
pub const fn is_unspecified(&self) -> bool
Returns true if this tag is the default / unspecified tag ({0, 0}).
pub fn to_bytes(&self) -> [u8; 16]
pub fn to_bytes(&self) -> [u8; 16]
Returns the raw bytes of this tag (16 bytes, little-endian).
Used when stamping audit tags into wire-format K2K message envelopes.
pub fn from_bytes(bytes: [u8; 16]) -> AuditTag
pub fn from_bytes(bytes: [u8; 16]) -> AuditTag
Reconstruct an AuditTag from its raw byte representation.
Trait Implementations§
§impl Archive for AuditTagwhere
u64: Archive,
impl Archive for AuditTagwhere
u64: Archive,
§type Archived = ArchivedAuditTag
type Archived = ArchivedAuditTag
§type Resolver = AuditTagResolver
type Resolver = AuditTagResolver
§impl AsBytes for AuditTag
impl AsBytes for AuditTag
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
§impl<__D> Deserialize<AuditTag, __D> for <AuditTag as Archive>::Archived
impl<__D> Deserialize<AuditTag, __D> for <AuditTag as Archive>::Archived
§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<AuditTag, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<AuditTag, <__D as Fallible>::Error>
§impl FromBytes for AuditTagwhere
u64: FromBytes,
impl FromBytes for AuditTagwhere
u64: FromBytes,
§fn ref_from_prefix(bytes: &[u8]) -> Option<&Self>where
Self: Sized,
fn ref_from_prefix(bytes: &[u8]) -> Option<&Self>where
Self: Sized,
§fn ref_from_suffix(bytes: &[u8]) -> Option<&Self>where
Self: Sized,
fn ref_from_suffix(bytes: &[u8]) -> Option<&Self>where
Self: Sized,
§fn mut_from_prefix(bytes: &mut [u8]) -> Option<&mut Self>where
Self: Sized + AsBytes,
fn mut_from_prefix(bytes: &mut [u8]) -> Option<&mut Self>where
Self: Sized + AsBytes,
§fn mut_from_suffix(bytes: &mut [u8]) -> Option<&mut Self>where
Self: Sized + AsBytes,
fn mut_from_suffix(bytes: &mut [u8]) -> Option<&mut Self>where
Self: Sized + AsBytes,
§fn slice_from(bytes: &[u8]) -> Option<&[Self]>where
Self: Sized,
fn slice_from(bytes: &[u8]) -> Option<&[Self]>where
Self: Sized,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized,
bytes as a &[Self] with length
equal to count without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized,
bytes as a &[Self] with length
equal to count without copying. Read more§fn mut_slice_from(bytes: &mut [u8]) -> Option<&mut [Self]>where
Self: Sized + AsBytes,
fn mut_slice_from(bytes: &mut [u8]) -> Option<&mut [Self]>where
Self: Sized + AsBytes,
§fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize,
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + AsBytes,
fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize,
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + AsBytes,
bytes as a &mut [Self] with length
equal to count without copying. Read more§fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize,
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + AsBytes,
fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize,
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + AsBytes,
bytes as a &mut [Self] with length
equal to count without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where
Self: Sized,
fn read_from_prefix(bytes: &[u8]) -> Option<Self>where
Self: Sized,
impl Copy for AuditTag
impl Eq for AuditTag
impl Pod for AuditTag
impl StructuralPartialEq for AuditTag
Auto Trait Implementations§
impl Freeze for AuditTag
impl RefUnwindSafe for AuditTag
impl Send for AuditTag
impl Sync for AuditTag
impl Unpin for AuditTag
impl UnwindSafe for AuditTag
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be unsized. Read more§type MetadataResolver = ()
type MetadataResolver = ()
§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata,
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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