Skip to main content

MetadataStore

Struct MetadataStore 

Source
pub struct MetadataStore { /* private fields */ }

Implementations§

Source§

impl MetadataStore

Source

pub fn fields(&self) -> impl Iterator<Item = &FieldDesc>

Source

pub fn query_slk_field( &self, field_name: &str, object: &Object, ) -> Option<(&FieldDesc, Option<u32>)>

Queries an SLK field by it’s name and target object. The object is necessary because the same field name can resolve to different fields depending on the object.

Source

pub fn query_profile_field( &self, field_name: &str, object: &Object, index: i8, ) -> Option<(&FieldDesc, Option<u32>)>

Queries a Profile field by it’s name and target object. The object is necessary because the same field name can resolve to different fields depending on the object.

Source

pub fn query_object_field( &self, field_id: ObjectId, object: &Object, ) -> Option<&FieldDesc>

Source

pub fn query_all_object_fields( &self, object: &Object, ) -> impl Iterator<Item = &FieldDesc>

Will return an iterator of all fields available for this object, irrespective of which fields exist on the object itself.

Source

pub fn query_lua_field( &self, object: &Object, full_name: &str, ) -> Option<(&FieldDesc, Option<u32>)>

First tries to fetch a Profile/Func field in the format of <field_name>, e.g. Buttonpos1 resolving to abpx for units, and Buttonpos2 resolving to abpy, if that fails then will try to grab an slk field using the regular approach

Source

pub fn field_by_id(&self, id: ObjectId) -> Option<&FieldDesc>

Trait Implementations§

Source§

impl Debug for MetadataStore

Source§

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

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

impl Default for MetadataStore

Source§

fn default() -> MetadataStore

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for MetadataStore

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MetadataStore

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.