[][src]Trait activitystreams::object::PlaceExt

pub trait PlaceExt: AsPlace {
    fn accuracy(&self) -> Option<f64> { ... }
fn set_accuracy<T>(&mut self, float: T) -> &mut Self
    where
        T: Into<f64>
, { ... }
fn take_accuracy(&mut self) -> Option<f64> { ... }
fn delete_accuracy(&mut self) -> &mut Self { ... }
fn altitude(&self) -> Option<f64> { ... }
fn set_altitude<T>(&mut self, float: T) -> &mut Self
    where
        T: Into<f64>
, { ... }
fn take_altitude(&mut self) -> Option<f64> { ... }
fn delete_altitude(&mut self) -> &mut Self { ... }
fn latitude(&self) -> Option<f64> { ... }
fn set_latitude<T>(&mut self, float: T) -> &mut Self
    where
        T: Into<f64>
, { ... }
fn take_latitude(&mut self) -> Option<f64> { ... }
fn delete_latitude(&mut self) -> &mut Self { ... }
fn longitude(&self) -> Option<f64> { ... }
fn set_longitude<T>(&mut self, float: T) -> &mut Self
    where
        T: Into<f64>
, { ... }
fn take_longitude(&mut self) -> Option<f64> { ... }
fn delete_longitude(&mut self) -> &mut Self { ... }
fn radius(&self) -> Option<f64> { ... }
fn set_radius<T>(&mut self, float: T) -> &mut Self
    where
        T: Into<f64>
, { ... }
fn take_radius(&mut self) -> Option<f64> { ... }
fn delete_radius(&mut self) -> &mut Self { ... }
fn units(&self) -> Option<&Unit> { ... }
fn set_units<T>(&mut self, units: T) -> &mut Self
    where
        T: Into<Unit>
, { ... }
fn take_units(&mut self) -> Option<Unit> { ... }
fn delete_units(&mut self) -> &mut Self { ... } }

Helper methods for interacting with Place types

This trait represents methods valid for any Place.

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

Provided methods

fn accuracy(&self) -> Option<f64>

Fetch the accuracy of the current object

use activitystreams::prelude::*;

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

fn set_accuracy<T>(&mut self, float: T) -> &mut Self where
    T: Into<f64>, 

Set the accuracy for the current object

This overwrites the contents of accuracy

use activitystreams::prelude::*;

place.set_accuracy(5f64);

fn take_accuracy(&mut self) -> Option<f64>

Take the accuracy of the current object, leaving nothing

use activitystreams::prelude::*;

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

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

Delete the accuracy from the current object

use activitystreams::prelude::*;

assert!(place.accuracy().is_some());
place.delete_accuracy();
assert!(place.accuracy().is_none());

fn altitude(&self) -> Option<f64>

Fetch the altitude of the current object

use activitystreams::prelude::*;

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

fn set_altitude<T>(&mut self, float: T) -> &mut Self where
    T: Into<f64>, 

Set the altitude for the current object

This overwrites the contents of altitude

use activitystreams::prelude::*;

place.set_altitude(5f64);

fn take_altitude(&mut self) -> Option<f64>

Take the altitude of the current object, leaving nothing

use activitystreams::prelude::*;

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

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

Delete the altitude from the current object

use activitystreams::prelude::*;

assert!(place.altitude().is_some());
place.delete_altitude();
assert!(place.altitude().is_none());

fn latitude(&self) -> Option<f64>

Fetch the latitude of the current object

use activitystreams::prelude::*;

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

fn set_latitude<T>(&mut self, float: T) -> &mut Self where
    T: Into<f64>, 

Set the latitude for the current object

This overwrites the contents of latitude

use activitystreams::prelude::*;

place.set_latitude(5f64);

fn take_latitude(&mut self) -> Option<f64>

Take the latitude of the current object, leaving nothing

use activitystreams::prelude::*;

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

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

Delete the latitude from the current object

use activitystreams::prelude::*;

assert!(place.latitude().is_some());
place.delete_latitude();
assert!(place.latitude().is_none());

fn longitude(&self) -> Option<f64>

Fetch the longitude of the current object

use activitystreams::prelude::*;

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

fn set_longitude<T>(&mut self, float: T) -> &mut Self where
    T: Into<f64>, 

Set the longitude for the current object

This overwrites the contents of longitude

use activitystreams::prelude::*;

place.set_longitude(5f64);

fn take_longitude(&mut self) -> Option<f64>

Take the longitude of the current object, leaving nothing

use activitystreams::prelude::*;

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

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

Delete the longitude from the current object

use activitystreams::prelude::*;

assert!(place.longitude().is_some());
place.delete_longitude();
assert!(place.longitude().is_none());

fn radius(&self) -> Option<f64>

Fetch the radius of the current object

use activitystreams::prelude::*;

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

fn set_radius<T>(&mut self, float: T) -> &mut Self where
    T: Into<f64>, 

Set the radius for the current object

This overwrites the contents of radius

use activitystreams::prelude::*;

place.set_radius(5f64);

fn take_radius(&mut self) -> Option<f64>

Take the radius of the current object, leaving nothing

use activitystreams::prelude::*;

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

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

Delete the radius from the current object

use activitystreams::prelude::*;

assert!(place.radius().is_some());
place.delete_radius();
assert!(place.radius().is_none());

fn units(&self) -> Option<&Unit>

Fetch the units of the current object

use activitystreams::prelude::*;

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

fn set_units<T>(&mut self, units: T) -> &mut Self where
    T: Into<Unit>, 

Set the units for the current object

This overwrites the contents of units

use activitystreams::{prelude::*, primitives::Unit};

place.set_units(Unit::centimeters());

fn take_units(&mut self) -> Option<Unit>

Take the units of the current object, leaving nothing

use activitystreams::prelude::*;

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

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

Delete the units from the current object

use activitystreams::prelude::*;

assert!(place.units().is_some());
place.delete_units();
assert!(place.units().is_none());
Loading content...

Implementors

impl<T> PlaceExt for T where
    T: AsPlace
[src]

Loading content...