Skip to main content

Channel

Struct Channel 

Source
pub struct Channel<T> { /* private fields */ }

Implementations§

Source§

impl<T: ChannelValue> Channel<T>

Source

pub const fn new( name: &'static CStr, availability: GameSchemaAvailability, ) -> Self

Source

pub const fn indexed( name: &'static CStr, availability: GameSchemaAvailability, ) -> Self

Creates a descriptor whose values are selected through the SDK index parameter, such as individual wheel or H-shifter selector channels.

Source

pub const fn name(self) -> &'static CStr

Source

pub const fn value_type(self) -> ScsValueType

Source

pub const fn is_indexed(self) -> bool

Whether registration requires an explicit zero-based SDK index.

Source

pub const fn availability(self) -> GameSchemaAvailability

Returns the first official ETS2 and ATS schemas for this channel.

Source

pub const fn requesting<U: ChannelValue>(self) -> Channel<U>

Requests the same channel using another SDK value representation.

SCS performs the authoritative compatibility check during registration and reports SCS_RESULT_unsupported_type when conversion is unavailable.

Source

pub const fn erase(self) -> AnyChannel

Erases the Rust marker type while preserving the SDK value discriminator.

This is the representation used by the plugin framework’s heterogeneous subscription table. A value can later be decoded with the original typed descriptor only when the names, index mode, and value types match.

Source

pub fn decode(self, value: ValueRef<'_>) -> Option<T::Decoded<'_>>

Decodes a callback value according to this descriptor’s requested type.

Trait Implementations§

Source§

impl<T> Clone for Channel<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Copy for Channel<T>

Source§

impl<T: Debug> Debug for Channel<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Eq> Eq for Channel<T>

Source§

impl<T: PartialEq> PartialEq for Channel<T>

Source§

fn eq(&self, other: &Channel<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: PartialEq> StructuralPartialEq for Channel<T>

Auto Trait Implementations§

§

impl<T> Freeze for Channel<T>

§

impl<T> RefUnwindSafe for Channel<T>

§

impl<T> Send for Channel<T>

§

impl<T> Sync for Channel<T>

§

impl<T> Unpin for Channel<T>

§

impl<T> UnsafeUnpin for Channel<T>

§

impl<T> UnwindSafe for Channel<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.