Struct javascriptcore6::Value

source ·
pub struct Value { /* private fields */ }
Expand description

JSCValue represents a reference to a value in a #JSCContext. The JSCValue protects the referenced value from being garbage collected.

§Properties

§context

The #JSCContext in which the value was created.

Readable | Writeable | Construct Only

GLib type: GObject with reference counted clone semantics.

Implementations§

source§

impl Value

source

pub fn new_array_from_garray(context: &Context, array: &[Value]) -> Value

Create a new #JSCValue referencing an array with the items from @array. If @array is None or empty a new empty array will be created. Elements of @array should be pointers to a #JSCValue.

§context

a #JSCContext

§array

a #GPtrArray

§Returns

a #JSCValue.

source

pub fn new_array_from_strv(context: &Context, strv: &[&str]) -> Value

Create a new #JSCValue referencing an array of strings with the items from @strv. If @array is None or empty a new empty array will be created.

§context

a #JSCContext

§strv

a None-terminated array of strings

§Returns

a #JSCValue.

source

pub fn new_boolean(context: &Context, value: bool) -> Value

Create a new #JSCValue from @value

§context

a #JSCContext

§value

a #gboolean

§Returns

a #JSCValue.

source

pub fn from_json(context: &Context, json: &str) -> Value

Create a new #JSCValue referencing a new value created by parsing @json.

§context

a #JSCContext

§json

the JSON string to be parsed

§Returns

a #JSCValue.

source

pub fn new_null(context: &Context) -> Value

Create a new #JSCValue referencing null in @context.

§context

a #JSCContext

§Returns

a #JSCValue.

source

pub fn new_number(context: &Context, number: f64) -> Value

Create a new #JSCValue from @number.

§context

a #JSCContext

§number

a number

§Returns

a #JSCValue.

source

pub fn new_string(context: &Context, string: Option<&str>) -> Value

Create a new #JSCValue from @string. If you need to create a #JSCValue from a string containing null characters, use jsc_value_new_string_from_bytes() instead.

§context

a #JSCContext

§string

a null-terminated string

§Returns

a #JSCValue.

source

pub fn new_string_from_bytes(context: &Context, bytes: Option<&Bytes>) -> Value

Create a new #JSCValue from @bytes.

§context

a #JSCContext

§bytes

a #GBytes

§Returns

a #JSCValue.

source

pub fn new_typed_array( context: &Context, type_: TypedArrayType, length: usize, ) -> Value

Create a new typed array containing a given amount of elements.

Create a #JSCValue referencing a new typed array with space for @length elements of a given @type_. As all typed arrays must have an associated ArrayBuffer, a new one of suitable size will be allocated to store the elements, which will be initialized to zero.

The @type_ must not be TypedArrayType::None.

§context

a #JSCContext

§type_

the type of array elements

§length

number of elements in the array

§Returns

a #JSCValue

source

pub fn new_undefined(context: &Context) -> Value

Create a new #JSCValue referencing undefined in @context.

§context

a #JSCContext

§Returns

a #JSCValue.

source

pub fn array_buffer_get_size(&self) -> usize

Gets the size in bytes of the array buffer.

Obtains the size in bytes of the memory region that holds the contents of an ArrayBuffer.

§Returns

size, in bytes.

source

pub fn constructor_callv(&self, parameters: &[Value]) -> Option<Value>

Invoke new with constructor referenced by @self. If @n_parameters is 0 no parameters will be passed to the constructor.

§parameters

the #JSCValues to pass as parameters to the constructor, or None

§Returns

a #JSCValue referencing the newly created object instance.

source

pub fn function_callv(&self, parameters: &[Value]) -> Option<Value>

Call function referenced by @self, passing the given @parameters. If @n_parameters is 0 no parameters will be passed to the function.

This function always returns a #JSCValue, in case of void functions a #JSCValue referencing undefined is returned

§parameters

the #JSCValues to pass as parameters to the function, or None

§Returns

a #JSCValue with the return value of the function.

source

pub fn context(&self) -> Option<Context>

Get the #JSCContext in which @self was created.

§Returns

the #JSCValue context.

source

pub fn is_array(&self) -> bool

Get whether the value referenced by @self is an array.

§Returns

whether the value is an array.

source

pub fn is_array_buffer(&self) -> bool

Check whether the @self is an ArrayBuffer.

§Returns

whether the value is an ArrayBuffer

source

pub fn is_boolean(&self) -> bool

Get whether the value referenced by @self is a boolean.

§Returns

whether the value is a boolean.

source

pub fn is_constructor(&self) -> bool

Get whether the value referenced by @self is a constructor.

§Returns

whether the value is a constructor.

source

pub fn is_function(&self) -> bool

Get whether the value referenced by @self is a function

§Returns

whether the value is a function.

source

pub fn is_null(&self) -> bool

Get whether the value referenced by @self is null.

§Returns

whether the value is null.

source

pub fn is_number(&self) -> bool

Get whether the value referenced by @self is a number.

§Returns

whether the value is a number.

source

pub fn is_object(&self) -> bool

Get whether the value referenced by @self is an object.

§Returns

whether the value is an object.

source

pub fn is_string(&self) -> bool

Get whether the value referenced by @self is a string

§Returns

whether the value is a string

source

pub fn is_typed_array(&self) -> bool

Determines whether a value is a typed array.

§Returns

Whether @self is a typed array.

source

pub fn is_undefined(&self) -> bool

Get whether the value referenced by @self is undefined.

§Returns

whether the value is undefined.

source

pub fn new_typed_array_with_buffer( &self, type_: TypedArrayType, offset: usize, length: isize, ) -> Option<Value>

Create a new typed array value with elements from an array buffer.

Create a #JSCValue referencing a new typed array value containing elements of the given @type_, where the elements are stored at the memory region represented by the @self.

The @type_ must not be TypedArrayType::None.

The @offset and @length parameters can be used to indicate which part of the array buffer can be accessed through the typed array. If both are omitted (passing zero as @offset, and -1 as @length), the whole @self is exposed through the typed array. Omitting the @length with a non-zero @offset will expose the remainder of the @self starting at the indicated offset.

§type_

type of array elements.

§offset

offset, in bytes.

§length

number of array elements, or -1.

§Returns

a #JSCValue

source

pub fn object_define_property_data( &self, property_name: &str, flags: ValuePropertyFlags, property_value: Option<&Value>, )

Define or modify a property with @property_name in object referenced by @self. This is equivalent to JavaScript Object.defineProperty() when used with a data descriptor.

§property_name

the name of the property to define

§flags

#JSCValuePropertyFlags

§property_value

the default property value

source

pub fn object_delete_property(&self, name: &str) -> bool

Try to delete property with @name from @self. This function will return false if the property was defined without ValuePropertyFlags::CONFIGURABLE flag.

§name

the property name

§Returns

true if the property was deleted, or false otherwise.

source

pub fn object_enumerate_properties(&self) -> Vec<GString>

Get the list of property names of @self. Only properties defined with ValuePropertyFlags::ENUMERABLE flag will be collected.

§Returns

a None-terminated array of strings containing the property names, or None if @self doesn’t have enumerable properties. Use g_strfreev() to free.

source

pub fn object_get_property(&self, name: &str) -> Option<Value>

Get property with @name from @self.

§name

the property name

§Returns

the property #JSCValue.

source

pub fn object_get_property_at_index(&self, index: u32) -> Option<Value>

Get property at @index from @self.

§index

the property index

§Returns

the property #JSCValue.

source

pub fn object_has_property(&self, name: &str) -> bool

Get whether @self has property with @name.

§name

the property name

§Returns

true if @self has a property with @name, or false otherwise

source

pub fn object_invoke_methodv( &self, name: &str, parameters: &[Value], ) -> Option<Value>

Invoke method with @name on object referenced by @self, passing the given @parameters. If @n_parameters is 0 no parameters will be passed to the method. The object instance will be handled automatically even when the method is a custom one registered with jsc_class_add_method(), so it should never be passed explicitly as parameter of this function.

This function always returns a #JSCValue, in case of void methods a #JSCValue referencing undefined is returned.

§name

the method name

§parameters

the #JSCValues to pass as parameters to the method, or None

§Returns

a #JSCValue with the return value of the method.

source

pub fn object_is_instance_of(&self, name: &str) -> bool

Get whether the value referenced by @self is an instance of class @name.

§name

a class name

§Returns

whether the value is an object instance of class @name.

source

pub fn object_set_property(&self, name: &str, property: &Value)

Set @property with @name on @self.

§name

the property name

§property

the #JSCValue to set

source

pub fn object_set_property_at_index(&self, index: u32, property: &Value)

Set @property at @index on @self.

§index

the property index

§property

the #JSCValue to set

source

pub fn to_boolean(&self) -> bool

Convert @self to a boolean.

§Returns

a #gboolean result of the conversion.

source

pub fn to_double(&self) -> f64

Convert @self to a double.

§Returns

a #gdouble result of the conversion.

source

pub fn to_int32(&self) -> i32

Convert @self to a #gint32.

§Returns

a #gint32 result of the conversion.

source

pub fn to_json(&self, indent: u32) -> Option<GString>

Create a JSON string of @self serialization. If @indent is 0, the resulting JSON will not contain newlines. The size of the indent is clamped to 10 spaces.

§indent

The number of spaces to indent when nesting.

§Returns

a null-terminated JSON string with serialization of @self

source

pub fn to_str(&self) -> GString

Convert @self to a string. Use jsc_value_to_string_as_bytes() instead, if you need to handle strings containing null characters.

§Returns

a null-terminated string result of the conversion.

source

pub fn to_string_as_bytes(&self) -> Option<Bytes>

Convert @self to a string and return the results as #GBytes. This is needed to handle strings with null characters.

§Returns

a #GBytes with the result of the conversion.

source

pub fn typed_array_get_buffer(&self) -> Option<Value>

Obtain the ArrayBuffer for the memory region of the typed array elements.

§Returns

A #JSCValue

source

pub fn typed_array_get_length(&self) -> usize

Gets the number of elements in a typed array.

§Returns

number of elements.

source

pub fn typed_array_get_offset(&self) -> usize

Gets the offset over the underlying array buffer data.

§Returns

offset, in bytes.

source

pub fn typed_array_get_size(&self) -> usize

Gets the size of a typed array.

§Returns

size, in bytes.

source

pub fn typed_array_get_type(&self) -> TypedArrayType

Gets the type of elements contained in a typed array.

§Returns

type of the elements, or TypedArrayType::None if @self is not a typed array.

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the object. Dropping the object will decrement it again.

1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Value

source§

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

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

impl Display for Value

source§

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

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

impl HasParamSpec for Value

§

type ParamSpec = ParamSpecObject

§

type SetValue = Value

Preferred value to be used as setter for the associated ParamSpec.
§

type BuilderFn = fn(_: &str) -> ParamSpecObjectBuilder<'_, Value>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl Hash for Value

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Hashes the memory address of this object.

1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Value

source§

fn cmp(&self, other: &Self) -> Ordering

Comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl ParentClassIs for Value

source§

impl<OT: ObjectType> PartialEq<OT> for Value

source§

fn eq(&self, other: &OT) -> bool

Equality for two GObjects.

Two GObjects are equal if their memory addresses are equal.

1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<OT: ObjectType> PartialOrd<OT> for Value

source§

fn partial_cmp(&self, other: &OT) -> Option<Ordering>

Partial comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StaticType for Value

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Eq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl !Send for Value

§

impl !Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

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> Cast for T
where T: ObjectType,

source§

fn upcast<T>(self) -> T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a superclass or interface T. Read more
source§

fn upcast_ref<T>(&self) -> &T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a reference of its superclass or interface T. Read more
source§

fn downcast<T>(self) -> Result<T, Self>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a subclass or interface implementor T. Read more
source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a reference of its subclass or interface implementor T. Read more
source§

fn dynamic_cast<T>(self) -> Result<T, Self>
where T: ObjectType,

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while upcast will do many checks at compile-time already. downcast will perform the same checks at runtime as dynamic_cast, but will also ensure some amount of compile-time safety. Read more
source§

fn dynamic_cast_ref<T>(&self) -> Option<&T>
where T: ObjectType,

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more
source§

unsafe fn unsafe_cast<T>(self) -> T
where T: ObjectType,

Casts to T unconditionally. Read more
source§

unsafe fn unsafe_cast_ref<T>(&self) -> &T
where T: ObjectType,

Casts to &T unconditionally. Read more
source§

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

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> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<U> IsSubclassableExt for U

source§

impl<T> ObjectExt for T
where T: ObjectType,

source§

fn is<U>(&self) -> bool
where U: StaticType,

Returns true if the object is an instance of (can be cast to) T.
source§

fn type_(&self) -> Type

Returns the type of the object.
source§

fn object_class(&self) -> &Class<Object>

Returns the ObjectClass of the object. Read more
source§

fn class(&self) -> &Class<T>
where T: IsClass,

Returns the class of the object.
source§

fn class_of<U>(&self) -> Option<&Class<U>>
where U: IsClass,

Returns the class of the object in the given type T. Read more
source§

fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>
where U: IsInterface,

Returns the interface T of the object. Read more
source§

fn set_property(&self, property_name: &str, value: impl Into<Value>)

Sets the property property_name of the object to value value. Read more
source§

fn set_property_from_value(&self, property_name: &str, value: &Value)

Sets the property property_name of the object to value value. Read more
source§

fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])

Sets multiple properties of the object at once. Read more
source§

fn set_properties_from_value(&self, property_values: &[(&str, Value)])

Sets multiple properties of the object at once. Read more
source§

fn property<V>(&self, property_name: &str) -> V
where V: for<'b> FromValue<'b> + 'static,

Gets the property property_name of the object and cast it to the type V. Read more
source§

fn property_value(&self, property_name: &str) -> Value

Gets the property property_name of the object. Read more
source§

fn has_property(&self, property_name: &str, type_: Option<Type>) -> bool

Check if the object has a property property_name of the given type_. Read more
source§

fn property_type(&self, property_name: &str) -> Option<Type>

Get the type of the property property_name of this object. Read more
source§

fn find_property(&self, property_name: &str) -> Option<ParamSpec>

Get the ParamSpec of the property property_name of this object.
source§

fn list_properties(&self) -> PtrSlice<ParamSpec>

Return all ParamSpec of the properties of this object.
source§

fn freeze_notify(&self) -> PropertyNotificationFreezeGuard

Freeze all property notifications until the return guard object is dropped. Read more
source§

unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn set_data<QD>(&self, key: &str, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

fn block_signal(&self, handler_id: &SignalHandlerId)

Block a given signal handler. Read more
source§

fn unblock_signal(&self, handler_id: &SignalHandlerId)

Unblock a given signal handler.
source§

fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)

Stop emission of the currently emitted signal.
source§

fn stop_signal_emission_by_name(&self, signal_name: &str)

Stop emission of the currently emitted signal by the (possibly detailed) signal name.
source§

fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_id on this object. Read more
source§

fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_id on this object. Read more
source§

unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_name on this object. Read more
source§

unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_id on this object. Read more
source§

fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_name on this object. Read more
source§

fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_id on this object. Read more
source§

fn watch_closure(&self, closure: &impl AsRef<Closure>)

Limits the lifetime of closure to the lifetime of the object. When the object’s reference count drops to zero, the closure will be invalidated. An invalidated closure will ignore any calls to invoke_with_values, or invoke when using Rust closures.
source§

fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> R

Emit signal by signal id. Read more
source§

fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>

Same as Self::emit but takes Value for the arguments.
source§

fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> R

Emit signal by its name. Read more
source§

fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>

Emit signal by its name. Read more
source§

fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by its name with details. Read more
source§

fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by its name with details. Read more
source§

fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by signal id with details. Read more
source§

fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by signal id with details. Read more
source§

fn disconnect(&self, handler_id: SignalHandlerId)

Disconnect a previously connected signal handler.
source§

fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + Send + Sync + 'static,

Connect to the notify signal of the object. Read more
source§

fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + 'static,

Connect to the notify signal of the object. Read more
source§

unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
where F: Fn(&T, &ParamSpec),

Connect to the notify signal of the object. Read more
source§

fn notify(&self, property_name: &str)

Notify that the given property has changed its value. Read more
source§

fn notify_by_pspec(&self, pspec: &ParamSpec)

Notify that the given property has changed its value. Read more
source§

fn downgrade(&self) -> WeakRef<T>

Downgrade this object to a weak reference.
source§

fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + Send + 'static,

Add a callback to be notified when the Object is disposed.
source§

fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + 'static,

Add a callback to be notified when the Object is disposed. Read more
source§

fn bind_property<'a, 'f, 't, O>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str, ) -> BindingBuilder<'a, 'f, 't>
where O: ObjectType,

Bind property source_property on this object to the target_property on the target object. Read more
source§

fn ref_count(&self) -> u32

Returns the strong reference count of this object.
source§

unsafe fn run_dispose(&self)

Runs the dispose mechanism of the object. Read more
source§

impl<T> Property for T
where T: HasParamSpec,

§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T> TransparentType for T

source§

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

§

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> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

source§

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

§

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

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,

source§

impl<Super, Sub> MayDowncastTo<Sub> for Super
where Super: IsA<Super>, Sub: IsA<Super>,