Struct arcdps::extras::ExtrasSubscriberInfo

source ·
#[repr(C)]
pub struct ExtrasSubscriberInfo { pub header: ExtrasSubscriberInfoHeader, pub subscriber_name: *const c_char, pub squad_update_callback: Option<RawExtrasSquadUpdateCallback>, pub language_changed_callback: Option<RawExtrasLanguageChangedCallback>, pub keybind_changed_callback: Option<RawExtrasKeybindChangedCallback>, pub chat_message_callback: Option<RawExtrasChatMessageCallback>, }
Expand description

Information about a subscriber to updates from Unofficial Extras.

Fields§

§header: ExtrasSubscriberInfoHeader

Header shared across different versions.

§subscriber_name: *const c_char

Name of the addon subscribing to the changes.

Must be valid for the lifetime of the subscribing addon. Set to nullptr if initialization fails.

§squad_update_callback: Option<RawExtrasSquadUpdateCallback>

Called whenever anything in the squad changes.

Only the users that changed are sent. If a user is removed from the squad, it will be sent with role set to UserRole::None

§language_changed_callback: Option<RawExtrasLanguageChangedCallback>

Called whenever the language is changed.

Either by Changing it in the UI or by pressing the Right Ctrl (default) key. Will also be called directly after initialization, with the current language, to get the startup language.

§keybind_changed_callback: Option<RawExtrasKeybindChangedCallback>

Called whenever a keybind is changed.

By changing it in the ingame UI, by pressing the translation shortcut or with the Presets feature of this plugin. It is called for every keybind separately.

After initialization this is called for every current keybind that exists. If you want to get a single keybind, at any time you want, call the exported function.

§chat_message_callback: Option<RawExtrasChatMessageCallback>

Called whenever a chat message is sent in your party/squad.

Implementations§

source§

impl ExtrasSubscriberInfo

source

pub unsafe fn subscribe( &mut self, extras_addon: &RawExtrasAddonInfo, name: &'static str, squad_update: Option<RawExtrasSquadUpdateCallback>, language_changed: Option<RawExtrasLanguageChangedCallback>, keybind_changed: Option<RawExtrasKeybindChangedCallback>, chat_message: Option<RawExtrasChatMessageCallback>, )

Subscribes to unofficial extras callbacks after checking for compatibility.

Unsupported callbacks will be skipped.

Name needs to be null-terminated.

Trait Implementations§

source§

impl Debug for ExtrasSubscriberInfo

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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.