Trait atk::prelude::RelationSetExt[][src]

pub trait RelationSetExt: 'static {
    fn add<P: IsA<Relation>>(&self, relation: &P);
fn add_relation_by_type<P: IsA<Object>>(
        &self,
        relationship: RelationType,
        target: &P
    );
fn contains(&self, relationship: RelationType) -> bool;
fn contains_target<P: IsA<Object>>(
        &self,
        relationship: RelationType,
        target: &P
    ) -> bool;
fn n_relations(&self) -> i32;
fn relation(&self, i: i32) -> Option<Relation>;
fn relation_by_type(&self, relationship: RelationType) -> Option<Relation>;
fn remove<P: IsA<Relation>>(&self, relation: &P); }
Expand description

Trait containing all RelationSet methods.

Implementors

RelationSet

Required methods

Add a new relation to the current relation set if it is not already present. This function ref’s the AtkRelation so the caller of this function should unref it to ensure that it will be destroyed when the AtkRelationSet is destroyed.

relation

an Relation

Add a new relation of the specified type with the specified target to the current relation set if the relation set does not contain a relation of that type. If it is does contain a relation of that typea the target is added to the relation.

relationship

an RelationType

target

an Object

Determines whether the relation set contains a relation that matches the specified type.

relationship

an RelationType

Returns

true if relationship is the relationship type of a relation in self, false otherwise

Determines whether the relation set contains a relation that matches the specified pair formed by type relationship and object target.

relationship

an RelationType

target

an Object

Returns

true if self contains a relation with the relationship type relationship with an object target, false otherwise

Determines the number of relations in a relation set.

Returns

an integer representing the number of relations in the set.

Determines the relation at the specified position in the relation set.

i

a gint representing a position in the set, starting from 0.

Returns

a Relation, which is the relation at position i in the set.

Finds a relation that matches the specified type.

relationship

an RelationType

Returns

an Relation, which is a relation matching the specified type.

Removes a relation from the relation set. This function unref’s the Relation so it will be deleted unless there is another reference to it.

relation

an Relation

Implementors