[][src]Trait atk::RelationSetExt

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 get_n_relations(&self) -> i32;
fn get_relation(&self, i: i32) -> Option<Relation>;
fn get_relation_by_type(
        &self,
        relationship: RelationType
    ) -> Option<Relation>;
fn remove<P: IsA<Relation>>(&self, relation: &P); }

Trait containing all RelationSet methods.

Implementors

RelationSet

Required methods

fn add<P: IsA<Relation>>(&self, relation: &P)

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

fn add_relation_by_type<P: IsA<Object>>(
    &self,
    relationship: RelationType,
    target: &P
)

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

fn contains(&self, relationship: RelationType) -> bool

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

fn contains_target<P: IsA<Object>>(
    &self,
    relationship: RelationType,
    target: &P
) -> bool

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

fn get_n_relations(&self) -> i32

Determines the number of relations in a relation set.

Returns

an integer representing the number of relations in the set.

fn get_relation(&self, i: i32) -> Option<Relation>

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.

fn get_relation_by_type(&self, relationship: RelationType) -> Option<Relation>

Finds a relation that matches the specified type.

relationship

an RelationType

Returns

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

fn remove<P: IsA<Relation>>(&self, relation: &P)

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

Loading content...

Implementors

impl<O: IsA<RelationSet>> RelationSetExt for O[src]

Loading content...