[][src]Trait activitystreams_new::collection::CollectionPageExt

pub trait CollectionPageExt<Kind>: AsCollectionPage<Kind> {
    fn part_of<'a>(&'a self) -> Option<&'a AnyBase>
    where
        Kind: 'a
, { ... }
fn set_part_of<T>(&mut self, part_of: T) -> &mut Self
    where
        T: Into<AnyBase>
, { ... }
fn take_part_of(&mut self) -> Option<AnyBase> { ... }
fn delete_part_of(&mut self) -> &mut Self { ... }
fn next<'a>(&'a self) -> Option<&'a AnyBase>
    where
        Kind: 'a
, { ... }
fn set_next<T>(&mut self, next: T) -> &mut Self
    where
        T: Into<AnyBase>
, { ... }
fn take_next(&mut self) -> Option<AnyBase> { ... }
fn delete_next(&mut self) -> &mut Self { ... }
fn prev<'a>(&'a self) -> Option<&'a AnyBase>
    where
        Kind: 'a
, { ... }
fn set_prev<T>(&mut self, prev: T) -> &mut Self
    where
        T: Into<AnyBase>
, { ... }
fn take_prev(&mut self) -> Option<AnyBase> { ... }
fn delete_prev(&mut self) -> &mut Self { ... } }

Helper methods for interacting with CollectionPage types

This trait represents methods valid for any ActivityStreams CollectionPage

Documentation for the fields related to these methods can be found on the CollectionPage struct

Provided methods

fn part_of<'a>(&'a self) -> Option<&'a AnyBase> where
    Kind: 'a, 

Fetch the part_of field for the current object

use activitystreams_new::prelude::*;

if let Some(part_of) = collection.part_of() {
    println!("{:?}", part_of);
}

fn set_part_of<T>(&mut self, part_of: T) -> &mut Self where
    T: Into<AnyBase>, 

Set the part_of field for the current object

This overwrites the contents of part_of

use activitystreams_new::{prelude::*, uri};

collection.set_part_of(uri!("https://example.com"));

fn take_part_of(&mut self) -> Option<AnyBase>

Take the part_of field from the current object, leaving nothing

use activitystreams_new::prelude::*;

if let Some(part_of) = collection.take_part_of() {
    println!("{:?}", part_of);
}

fn delete_part_of(&mut self) -> &mut Self

Delete the part_of field from the current object

use activitystreams_new::prelude::*;

assert!(collection.part_of().is_some());
collection.delete_part_of();
assert!(collection.part_of().is_none());

fn next<'a>(&'a self) -> Option<&'a AnyBase> where
    Kind: 'a, 

Fetch the next field for the current object

use activitystreams_new::prelude::*;

if let Some(next) = collection.next() {
    println!("{:?}", next);
}

fn set_next<T>(&mut self, next: T) -> &mut Self where
    T: Into<AnyBase>, 

Set the next field for the current object

This overwrites the contents of next

use activitystreams_new::{prelude::*, uri};

collection.set_next(uri!("https://example.com"));

fn take_next(&mut self) -> Option<AnyBase>

Take the next field from the current object, leaving nothing

use activitystreams_new::prelude::*;

if let Some(next) = collection.take_next() {
    println!("{:?}", next);
}

fn delete_next(&mut self) -> &mut Self

Delete the next field from the current object

use activitystreams_new::prelude::*;

assert!(collection.next().is_some());
collection.delete_next();
assert!(collection.next().is_none());

fn prev<'a>(&'a self) -> Option<&'a AnyBase> where
    Kind: 'a, 

Fetch the prev field for the current object

use activitystreams_new::prelude::*;

if let Some(prev) = collection.prev() {
    println!("{:?}", prev);
}

fn set_prev<T>(&mut self, prev: T) -> &mut Self where
    T: Into<AnyBase>, 

Set the prev field for the current object

This overwrites the contents of prev

use activitystreams_new::{prelude::*, uri};

collection.set_prev(uri!("https://example.com"));

fn take_prev(&mut self) -> Option<AnyBase>

Take the prev field from the current object, leaving nothing

use activitystreams_new::prelude::*;

if let Some(prev) = collection.take_prev() {
    println!("{:?}", prev);
}

fn delete_prev(&mut self) -> &mut Self

Delete the prev field from the current object

use activitystreams_new::prelude::*;

assert!(collection.prev().is_some());
collection.delete_prev();
assert!(collection.prev().is_none());
Loading content...

Implementors

impl<T, Kind> CollectionPageExt<Kind> for T where
    T: AsCollectionPage<Kind>, 
[src]

Loading content...