pub struct ExtrasVersion {
pub api_version: u32,
pub max_info_version: u32,
}Expand description
Helper for version checks.
Fields§
§api_version: u32Version of the API.
Gets incremented whenever a function signature or behavior changes in a breaking way.
max_info_version: u32Highest known version of the ExtrasSubscriberInfo struct.
Also determines the size of the subscriber info buffer in the init call.
The buffer is only guaranteed to have enough space for known ExtrasSubscriberInfo versions.
Implementations§
Source§impl ExtrasVersion
impl ExtrasVersion
Sourcepub const SUB_INFO_RANGE: RangeInclusive<u32>
pub const SUB_INFO_RANGE: RangeInclusive<u32>
Range of supported ExtrasSubscriberInfo versions.
Sourcepub const MIN_SUB_INFO: u32 = 1u32
pub const MIN_SUB_INFO: u32 = 1u32
Minimum supported ExtrasSubscriberInfo version.
Sourcepub const MAX_SUB_INFO: u32 = 3u32
pub const MAX_SUB_INFO: u32 = 3u32
Maximum supported ExtrasSubscriberInfo version.
Sourcepub const MESSAGE_CALLBACK: u32 = 2u32
pub const MESSAGE_CALLBACK: u32 = 2u32
Minimum ExtrasSubscriberInfo version for message callback.
Sourcepub const MESSAGE_CALLBACK2: u32 = 3u32
pub const MESSAGE_CALLBACK2: u32 = 3u32
Minimum ExtrasSubscriberInfo version for message callback 2.
Sourcepub const fn new(api_version: u32, max_info_version: u32) -> Self
pub const fn new(api_version: u32, max_info_version: u32) -> Self
Creates new version information.
Sourcepub const fn is_compatible(&self) -> bool
pub const fn is_compatible(&self) -> bool
Checks compatibility with the Unofficial Extras addon.
Sourcepub fn get_version_to_use(&self) -> Option<u32>
pub fn get_version_to_use(&self) -> Option<u32>
Checks for compatibility and returns the highest supported ExtrasSubscriberInfo version supported by Unofficial Extras & the bindings.
Sourcepub const fn supports_squad_chat_message(&self) -> bool
pub const fn supports_squad_chat_message(&self) -> bool
Whether the Unofficial Extras addon supports squad chat message callback.
Sourcepub const fn supports_chat_message2(&self) -> bool
pub const fn supports_chat_message2(&self) -> bool
Whether the Unofficial Extras addon supports chat message callback 2.
Trait Implementations§
Source§impl Clone for ExtrasVersion
impl Clone for ExtrasVersion
Source§fn clone(&self) -> ExtrasVersion
fn clone(&self) -> ExtrasVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more