Struct SubscribeMetricsRequest
#[repr(C)]pub struct SubscribeMetricsRequest {
pub actor_id: u64,
pub interval_us: u64,
pub subscription_id: u64,
}Expand description
H2K command: subscribe to metrics from a GPU actor.
Encoded into the H2K message payload on the CUDA backend. interval_us
of 0 is interpreted as an unsubscribe request.
§Wire Layout
The type is #[repr(C)] and Pod-like (no padding-sensitive fields) so
it maps 1:1 to the GPU-side C struct of the same name.
Fields§
§actor_id: u64Target actor (thread-block index on GPU).
interval_us: u64Emission interval in microseconds; 0 = unsubscribe.
subscription_id: u64Caller-generated subscription ID (echoed back in events).
Implementations§
§impl SubscribeMetricsRequest
impl SubscribeMetricsRequest
pub const fn new(
actor_id: u64,
interval_us: u64,
subscription_id: u64,
) -> SubscribeMetricsRequest
pub const fn new( actor_id: u64, interval_us: u64, subscription_id: u64, ) -> SubscribeMetricsRequest
Construct a new subscribe request.
pub const fn unsubscribe(
actor_id: u64,
subscription_id: u64,
) -> SubscribeMetricsRequest
pub const fn unsubscribe( actor_id: u64, subscription_id: u64, ) -> SubscribeMetricsRequest
Construct an unsubscribe request (interval = 0).
pub const fn is_unsubscribe(&self) -> bool
pub const fn is_unsubscribe(&self) -> bool
Return true if this message is an unsubscribe request.
pub fn from_bytes(bytes: &[u8]) -> Option<SubscribeMetricsRequest>
pub fn from_bytes(bytes: &[u8]) -> Option<SubscribeMetricsRequest>
Deserialize from a byte slice. Returns None if the slice is too short.
Trait Implementations§
§impl Clone for SubscribeMetricsRequest
impl Clone for SubscribeMetricsRequest
§fn clone(&self) -> SubscribeMetricsRequest
fn clone(&self) -> SubscribeMetricsRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for SubscribeMetricsRequest
impl Debug for SubscribeMetricsRequest
§impl PartialEq for SubscribeMetricsRequest
impl PartialEq for SubscribeMetricsRequest
impl Copy for SubscribeMetricsRequest
impl Eq for SubscribeMetricsRequest
impl StructuralPartialEq for SubscribeMetricsRequest
Auto Trait Implementations§
impl Freeze for SubscribeMetricsRequest
impl RefUnwindSafe for SubscribeMetricsRequest
impl Send for SubscribeMetricsRequest
impl Sync for SubscribeMetricsRequest
impl Unpin for SubscribeMetricsRequest
impl UnwindSafe for SubscribeMetricsRequest
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
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>
Deserializes using the given deserializer
§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>
Converts
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>
Converts
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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.