pub trait MetaContainerExt: IsA<MetaContainer> + Sealed + 'static {
Show 41 methods // Provided methods fn add_metas_from_string(&self, str: &str) -> bool { ... } fn check_meta_registered(&self, meta_item: &str) -> Option<(MetaFlag, Type)> { ... } fn foreach<P: FnMut(&MetaContainer, &str, &Value)>(&self, func: P) { ... } fn boolean(&self, meta_item: &str) -> Option<bool> { ... } fn date(&self, meta_item: &str) -> Option<Date> { ... } fn date_time(&self, meta_item: &str) -> Option<DateTime> { ... } fn double(&self, meta_item: &str) -> Option<f64> { ... } fn float(&self, meta_item: &str) -> Option<f32> { ... } fn int(&self, meta_item: &str) -> Option<i32> { ... } fn int64(&self, meta_item: &str) -> Option<i64> { ... } fn marker_list(&self, key: &str) -> Option<MarkerList> { ... } fn meta(&self, key: &str) -> Option<Value> { ... } fn string(&self, meta_item: &str) -> Option<GString> { ... } fn uint(&self, meta_item: &str) -> Option<u32> { ... } fn uint64(&self, meta_item: &str) -> Option<u64> { ... } fn metas_to_string(&self) -> GString { ... } fn register_meta( &self, flags: MetaFlag, meta_item: &str, value: &Value, ) -> bool { ... } fn register_meta_boolean( &self, flags: MetaFlag, meta_item: &str, value: bool, ) -> bool { ... } fn register_meta_date( &self, flags: MetaFlag, meta_item: &str, value: &Date, ) -> bool { ... } fn register_meta_date_time( &self, flags: MetaFlag, meta_item: &str, value: &DateTime, ) -> bool { ... } fn register_meta_double( &self, flags: MetaFlag, meta_item: &str, value: f64, ) -> bool { ... } fn register_meta_float( &self, flags: MetaFlag, meta_item: &str, value: f32, ) -> bool { ... } fn register_meta_int( &self, flags: MetaFlag, meta_item: &str, value: i32, ) -> bool { ... } fn register_meta_int64( &self, flags: MetaFlag, meta_item: &str, value: i64, ) -> bool { ... } fn register_meta_string( &self, flags: MetaFlag, meta_item: &str, value: &str, ) -> bool { ... } fn register_meta_uint( &self, flags: MetaFlag, meta_item: &str, value: u32, ) -> bool { ... } fn register_meta_uint64( &self, flags: MetaFlag, meta_item: &str, value: u64, ) -> bool { ... } fn register_static_meta( &self, flags: MetaFlag, meta_item: &str, type_: Type, ) -> bool { ... } fn set_boolean(&self, meta_item: &str, value: bool) -> bool { ... } fn set_date(&self, meta_item: &str, value: &Date) -> bool { ... } fn set_date_time(&self, meta_item: &str, value: &DateTime) -> bool { ... } fn set_double(&self, meta_item: &str, value: f64) -> bool { ... } fn set_float(&self, meta_item: &str, value: f32) -> bool { ... } fn set_int(&self, meta_item: &str, value: i32) -> bool { ... } fn set_int64(&self, meta_item: &str, value: i64) -> bool { ... } fn set_marker_list(&self, meta_item: &str, list: &MarkerList) -> bool { ... } fn set_meta(&self, meta_item: &str, value: Option<&Value>) -> bool { ... } fn set_string(&self, meta_item: &str, value: &str) -> bool { ... } fn set_uint(&self, meta_item: &str, value: u32) -> bool { ... } fn set_uint64(&self, meta_item: &str, value: u64) -> bool { ... } fn connect_notify_meta<F: Fn(&Self, &str, Option<&Value>) + 'static>( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Provided Methods§

source

fn add_metas_from_string(&self, str: &str) -> bool

Deserializes the given string, and adds and sets the found fields and their values on the container. The string should be the return of metas_to_string().

§str

A string to deserialize and add to self

§Returns

true if the fields in str was successfully deserialized and added to self.

source

fn check_meta_registered(&self, meta_item: &str) -> Option<(MetaFlag, Type)>

Checks whether the specified field has been registered as static, and gets the registered type and flags of the field, as used in register_meta() and register_static_meta().

§meta_item

The key for the self field to check

§Returns

true if the meta_item field has been registered on self.

§flags

A destination to get the registered flags of the field, or None to ignore

§type_

A destination to get the registered type of the field, or None to ignore

source

fn foreach<P: FnMut(&MetaContainer, &str, &Value)>(&self, func: P)

Calls the given function on each of the meta container’s set metadata fields.

§func

A function to call on each of self’s set metadata fields

source

fn boolean(&self, meta_item: &str) -> Option<bool>

Gets the current boolean value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§meta_item

The key for the self field to get

§Returns

true if the boolean value under meta_item was copied to dest.

§dest

Destination into which the value under meta_item should be copied.

source

fn date(&self, meta_item: &str) -> Option<Date>

Gets the current date value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§meta_item

The key for the self field to get

§Returns

true if the date value under meta_item was copied to dest.

§dest

Destination into which the value under meta_item should be copied.

source

fn date_time(&self, meta_item: &str) -> Option<DateTime>

Gets the current date time value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§meta_item

The key for the self field to get

§Returns

true if the date time value under meta_item was copied to dest.

§dest

Destination into which the value under meta_item should be copied.

source

fn double(&self, meta_item: &str) -> Option<f64>

Gets the current double value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§meta_item

The key for the self field to get

§Returns

true if the double value under meta_item was copied to dest.

§dest

Destination into which the value under meta_item should be copied.

source

fn float(&self, meta_item: &str) -> Option<f32>

Gets the current float value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§meta_item

The key for the self field to get

§Returns

true if the float value under meta_item was copied to dest.

§dest

Destination into which the value under meta_item should be copied.

source

fn int(&self, meta_item: &str) -> Option<i32>

Gets the current int value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§meta_item

The key for the self field to get

§Returns

true if the int value under meta_item was copied to dest.

§dest

Destination into which the value under meta_item should be copied.

source

fn int64(&self, meta_item: &str) -> Option<i64>

Gets the current int64 value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§meta_item

The key for the self field to get

§Returns

true if the int64 value under meta_item was copied to dest.

§dest

Destination into which the value under meta_item should be copied.

source

fn marker_list(&self, key: &str) -> Option<MarkerList>

Gets the current marker list value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§key

The key for the self field to get

§Returns

A copy of the marker list value under key, or None if it could not be fetched.

source

fn meta(&self, key: &str) -> Option<Value>

Gets the current value of the specified field of the meta container.

§key

The key for the self field to get

§Returns

The value under key, or None if self does not have the field set.

source

fn string(&self, meta_item: &str) -> Option<GString>

Gets the current string value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§meta_item

The key for the self field to get

§Returns

The string value under meta_item, or None if it could not be fetched.

source

fn uint(&self, meta_item: &str) -> Option<u32>

Gets the current uint value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§meta_item

The key for the self field to get

§Returns

true if the uint value under meta_item was copied to dest.

§dest

Destination into which the value under meta_item should be copied.

source

fn uint64(&self, meta_item: &str) -> Option<u64>

Gets the current uint64 value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

§meta_item

The key for the self field to get

§Returns

true if the uint64 value under meta_item was copied to dest.

§dest

Destination into which the value under meta_item should be copied.

source

fn metas_to_string(&self) -> GString

Serializes the set metadata fields of the meta container to a string.

§Returns

A serialized self.

source

fn register_meta(&self, flags: MetaFlag, meta_item: &str, value: &Value) -> bool

Sets the value of the specified field of the meta container to the given value, and registers the field to only hold a value of the same type. After calling this, only values of the same type as value can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold value types, with the given flags, and the field was successfully set to value.

source

fn register_meta_boolean( &self, flags: MetaFlag, meta_item: &str, value: bool, ) -> bool

Sets the value of the specified field of the meta container to the given boolean value, and registers the field to only hold a boolean typed value. After calling this, only boolean values can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold boolean typed values, with the given flags, and the field was successfully set to value.

source

fn register_meta_date( &self, flags: MetaFlag, meta_item: &str, value: &Date, ) -> bool

Sets the value of the specified field of the meta container to the given date value, and registers the field to only hold a date typed value. After calling this, only date values can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold date typed values, with the given flags, and the field was successfully set to value.

source

fn register_meta_date_time( &self, flags: MetaFlag, meta_item: &str, value: &DateTime, ) -> bool

Sets the value of the specified field of the meta container to the given date time value, and registers the field to only hold a date time typed value. After calling this, only date time values can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold date time typed values, with the given flags, and the field was successfully set to value.

source

fn register_meta_double( &self, flags: MetaFlag, meta_item: &str, value: f64, ) -> bool

Sets the value of the specified field of the meta container to the given double value, and registers the field to only hold a double typed value. After calling this, only double values can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold double typed values, with the given flags, and the field was successfully set to value.

source

fn register_meta_float( &self, flags: MetaFlag, meta_item: &str, value: f32, ) -> bool

Sets the value of the specified field of the meta container to the given float value, and registers the field to only hold a float typed value. After calling this, only float values can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold float typed values, with the given flags, and the field was successfully set to value.

source

fn register_meta_int( &self, flags: MetaFlag, meta_item: &str, value: i32, ) -> bool

Sets the value of the specified field of the meta container to the given int value, and registers the field to only hold an int typed value. After calling this, only int values can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold int typed values, with the given flags, and the field was successfully set to value.

source

fn register_meta_int64( &self, flags: MetaFlag, meta_item: &str, value: i64, ) -> bool

Sets the value of the specified field of the meta container to the given int64 value, and registers the field to only hold an int64 typed value. After calling this, only int64 values can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold int64 typed values, with the given flags, and the field was successfully set to value.

source

fn register_meta_string( &self, flags: MetaFlag, meta_item: &str, value: &str, ) -> bool

Sets the value of the specified field of the meta container to the given string value, and registers the field to only hold a string typed value. After calling this, only string values can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold string typed values, with the given flags, and the field was successfully set to value.

source

fn register_meta_uint( &self, flags: MetaFlag, meta_item: &str, value: u32, ) -> bool

Sets the value of the specified field of the meta container to the given uint value, and registers the field to only hold a uint typed value. After calling this, only uint values can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold uint typed values, with the given flags, and the field was successfully set to value.

source

fn register_meta_uint64( &self, flags: MetaFlag, meta_item: &str, value: u64, ) -> bool

Sets the value of the specified field of the meta container to the given uint64 value, and registers the field to only hold a uint64 typed value. After calling this, only uint64 values can be set for this field. The given flags can be set to make this field only readable after calling this method.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§value

The value to set for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold uint64 typed values, with the given flags, and the field was successfully set to value.

source

fn register_static_meta( &self, flags: MetaFlag, meta_item: &str, type_: Type, ) -> bool

Registers a static metadata field on the container to only hold the specified type. After calling this, setting a value under this field can only succeed if its type matches the registered type of the field.

Unlike register_meta(), no (initial) value is set for this field, which means you can use this method to reserve the space to be optionally set later.

Note that if a value has already been set for the field being registered, then its type must match the registering type, and its value will be left in place. If the field has no set value, then you will likely want to include MetaFlag::WRITABLE in flags to allow the value to be set later.

§flags

Flags to be used for the registered field

§meta_item

The key for the self field to register

§type_

The required value type for the registered field

§Returns

true if the meta_item field was successfully registered on self to only hold type_ values, with the given flags.

source

fn set_boolean(&self, meta_item: &str, value: bool) -> bool

Sets the value of the specified field of the meta container to the given boolean value.

§meta_item

The key for the self field to set

§value

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn set_date(&self, meta_item: &str, value: &Date) -> bool

Sets the value of the specified field of the meta container to the given date value.

§meta_item

The key for the self field to set

§value

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn set_date_time(&self, meta_item: &str, value: &DateTime) -> bool

Sets the value of the specified field of the meta container to the given date time value.

§meta_item

The key for the self field to set

§value

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn set_double(&self, meta_item: &str, value: f64) -> bool

Sets the value of the specified field of the meta container to the given double value.

§meta_item

The key for the self field to set

§value

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn set_float(&self, meta_item: &str, value: f32) -> bool

Sets the value of the specified field of the meta container to the given float value.

§meta_item

The key for the self field to set

§value

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn set_int(&self, meta_item: &str, value: i32) -> bool

Sets the value of the specified field of the meta container to the given int value.

§meta_item

The key for the self field to set

§value

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn set_int64(&self, meta_item: &str, value: i64) -> bool

Sets the value of the specified field of the meta container to the given int64 value.

§meta_item

The key for the self field to set

§value

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn set_marker_list(&self, meta_item: &str, list: &MarkerList) -> bool

Sets the value of the specified field of the meta container to the given marker list value.

§meta_item

The key for the self field to set

§list

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn set_meta(&self, meta_item: &str, value: Option<&Value>) -> bool

Sets the value of the specified field of the meta container to a copy of the given value. If the given value is None, the field given by meta_item is removed and true is returned.

§meta_item

The key for the self field to set

§value

The value to set under meta_item, or None to remove the corresponding field

§Returns

true if value was set under meta_item for self.

source

fn set_string(&self, meta_item: &str, value: &str) -> bool

Sets the value of the specified field of the meta container to the given string value.

§meta_item

The key for the self field to set

§value

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn set_uint(&self, meta_item: &str, value: u32) -> bool

Sets the value of the specified field of the meta container to the given uint value.

§meta_item

The key for the self field to set

§value

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn set_uint64(&self, meta_item: &str, value: u64) -> bool

Sets the value of the specified field of the meta container to the given uint64 value.

§meta_item

The key for the self field to set

§value

The value to set under meta_item

§Returns

true if value was set under meta_item for self.

source

fn connect_notify_meta<F: Fn(&Self, &str, Option<&Value>) + 'static>( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId

This is emitted for a meta container whenever the metadata under one of its fields changes, is set for the first time, or is removed. In the latter case, value will be None.

§key

The key for the container field that changed

§value

The new value under key

Object Safety§

This trait is not object safe.

Implementors§