pub struct ChannelUpdate<'a> { /* private fields */ }Expand description
One safely borrowed channel callback.
Numeric and geometry values may be copied out and retained. String values borrow storage owned by the game and therefore remain tied to this update’s callback lifetime.
Implementations§
Source§impl<'a> ChannelUpdate<'a>
impl<'a> ChannelUpdate<'a>
Sourcepub const fn channel(self) -> AnyChannel
pub const fn channel(self) -> AnyChannel
Type-erased canonical descriptor originally supplied by the plugin.
Sourcepub fn registered_name(self) -> Cow<'a, str>
pub fn registered_name(self) -> Cow<'a, str>
Exact name registered with SCS, including a multi-trailer prefix.
Official channel names are ASCII. The lossy return type also keeps this method total if a future SDK accepts a non-UTF-8 custom channel name.
Sourcepub const fn index(self) -> Option<SdkIndex>
pub const fn index(self) -> Option<SdkIndex>
Zero-based SDK array index, or None for a scalar channel.
Sourcepub const fn trailer_index(self) -> Option<TrailerIndex>
pub const fn trailer_index(self) -> Option<TrailerIndex>
Zero-based trailer number embedded in the registered name.
Sourcepub const fn flags(self) -> ChannelFlags
pub const fn flags(self) -> ChannelFlags
Delivery flags used for this subscription.
Sourcepub const fn value_ref(self) -> Option<ValueRef<'a>>
pub const fn value_ref(self) -> Option<ValueRef<'a>>
Raw safe view of the tagged value, absent for NO_VALUE subscriptions.
Sourcepub fn is<T: ChannelValue>(self, channel: Channel<T>) -> bool
pub fn is<T: ChannelValue>(self, channel: Channel<T>) -> bool
Tests whether this update belongs to a particular typed descriptor.
Trait Implementations§
Source§impl<'a> Clone for ChannelUpdate<'a>
impl<'a> Clone for ChannelUpdate<'a>
Source§fn clone(&self) -> ChannelUpdate<'a>
fn clone(&self) -> ChannelUpdate<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more