[−][src]Struct activitystreams_types::link::properties::LinkProperties
Define all the properties of the Object base type as described by the Activity Streams vocabulary.
The properties of the Link object are not the properties of the referenced resource, but are
provided as hints for rendering agents to understand how to make use of the resource. For
example, height and width might represent the desired rendered size of a referenced image,
rather than the actual pixel dimensions of the referenced image.
The target URI of the Link is expressed using the required href property.
For example, all Objects can contain an image property whose value describes a graphical representation of the containing object. This property will typically be used to provide the URL to an image (e.g. JPEG, GIF or PNG) resource that can be displayed to the user. Any given object might have multiple such visual representations -- multiple screenshots, for instance, or the same image at different resolutions. In Activity Streams 2.0, there are essentially three ways of describing such references.
Fields
id: Option<Value>Provides the globally unique identifier for an Object or Link.
The id property is expressed as an absolute IRI in the spec, but for now is represented
as a string.
- Range:
anyUri - Functional: true
context: Option<Value>Identifies the context within which the object exists or an activity was performed.
The notion of "context" used is intentionally vague. The intended function is to serve as a means of grouping objects and activities that share a common originating context or purpose. An example could be all activities relating to a common project or event.
- Range:
Object|Link - Functional: false
name: Option<Value>A simple, human-readable, plain-text name for the object.
HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
- Range:
xsd:string|rdf:langString - Functional: false
href: Option<Value>The target resource pointed to by a Link.
- Range:
xsd:anyUri - Functional: true
hreflang: Option<Value>Hints as to the language used by the target resource.
Value MUST be a [BCP47] Language-Tag.
- Range: [BCP47] Language Tag
- Functional: true
media_type: Option<Value>When used on a Link, identifies the MIME media type of the referenced resource.
If not specified, the content property is assumed to contain text/html content.
- Range:
Mime Media Type - Functional: true
rel: Option<Value>A link relation associated with a Link.
The value MUST conform to both the [HTML5] and [RFC5988] "link relation" definitions.
In the [HTML5], any string not containing the "space" U+0020, "tab" (U+0009), "LF" (U+000A), "FF" (U+000C), "CR" (U+000D) or "," (U+002C) characters can be used as a valid link relation.
height: Option<Value>On a Link, specifies a hint as to the rendering height in device-independent pixels of the
linked resource.
- Range:
xsd:nonNegativeInteger - Functional: true
width: Option<Value>On a Link, specifies a hint as to the rendering width in device-independent pixels of the
linked resource.
- Range:
xsd:nonNegativeInteger - Functional: true
preview: Option<Value>Identifies an entity that provides a preview of this object.
- Range:
Object|Link - Functional: false
Methods
impl LinkProperties[src]
impl LinkPropertiespub fn id_string(&self) -> Result<String> | [src] |
Retrieve a value from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_id_string(&mut self, item: String) -> Result<()> | [src] |
Set a value in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn context_object<T: Object>(&self) -> Result<T> | [src] |
Retrieve a value of type T from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_context_object<T: Object>(&mut self, item: T) -> Result<()> | [src] |
Set a value of type T in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn context_object_vec<T: Object>(&self) -> Result<Vec<T>> | [src] |
Retrieve many values of type T from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_context_object_vec<T: Object>(&mut self, item: Vec<T>) -> Result<()> | [src] |
Set many values of type T in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn context_link<T: Link>(&self) -> Result<T> | [src] |
Retrieve a value of type T from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_context_link<T: Link>(&mut self, item: T) -> Result<()> | [src] |
Set a value of type T in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn context_link_vec<T: Link>(&self) -> Result<Vec<T>> | [src] |
Retrieve many values of type T from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_context_link_vec<T: Link>(&mut self, item: Vec<T>) -> Result<()> | [src] |
Set many values of type T in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn name_string(&self) -> Result<String> | [src] |
Retrieve a value from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_name_string(&mut self, item: String) -> Result<()> | [src] |
Set a value in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn name_string_vec(&self) -> Result<Vec<String>> | [src] |
Retrieve many values from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_name_string_vec(&mut self, item: Vec<String>) -> Result<()> | [src] |
Set many values in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn href_string(&self) -> Result<String> | [src] |
Retrieve a value from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_href_string(&mut self, item: String) -> Result<()> | [src] |
Set a value in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn hreflang_string(&self) -> Result<String> | [src] |
Retrieve a value from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_hreflang_string(&mut self, item: String) -> Result<()> | [src] |
Set a value in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn media_type_string(&self) -> Result<String> | [src] |
Retrieve a value from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_media_type_string(&mut self, item: String) -> Result<()> | [src] |
Set a value in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn rel_string(&self) -> Result<String> | [src] |
Retrieve a value from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_rel_string(&mut self, item: String) -> Result<()> | [src] |
Set a value in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn rel_string_vec(&self) -> Result<Vec<String>> | [src] |
Retrieve many values from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_rel_string_vec(&mut self, item: Vec<String>) -> Result<()> | [src] |
Set many values in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn height_u64(&self) -> Result<u64> | [src] |
Retrieve a value from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_height_u64(&mut self, item: u64) -> Result<()> | [src] |
Set a value in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn width_u64(&self) -> Result<u64> | [src] |
Retrieve a value from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_width_u64(&mut self, item: u64) -> Result<()> | [src] |
Set a value in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn preview_object<T: Object>(&self) -> Result<T> | [src] |
Retrieve a value of type T from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_preview_object<T: Object>(&mut self, item: T) -> Result<()> | [src] |
Set a value of type T in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn preview_object_vec<T: Object>(&self) -> Result<Vec<T>> | [src] |
Retrieve many values of type T from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_preview_object_vec<T: Object>(&mut self, item: Vec<T>) -> Result<()> | [src] |
Set many values of type T in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn preview_link<T: Link>(&self) -> Result<T> | [src] |
Retrieve a value of type T from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_preview_link<T: Link>(&mut self, item: T) -> Result<()> | [src] |
Set a value of type T in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
pub fn preview_link_vec<T: Link>(&self) -> Result<Vec<T>> | [src] |
Retrieve many values of type T from the given struct
This method deserializes the item from JSON, so be wary of using this a lot.
Possible errors from this method are Error::NotFound and
Error::Deserialize
pub fn set_preview_link_vec<T: Link>(&mut self, item: Vec<T>) -> Result<()> | [src] |
Set many values of type T in the given struct
This method serializes the item to JSON, so be wary of using this a lot.
Possible errors from this method are Error::Serialize
impl LinkProperties[src]
impl LinkPropertiespub fn media_type(&self) -> Result<Mime> | [src] |
Fetch a typed Mime struct from the media_type field.
Trait Implementations
impl Default for LinkProperties[src]
impl Default for LinkPropertiesfn default() -> LinkProperties | [src] |
impl Clone for LinkProperties[src]
impl Clone for LinkPropertiesfn clone(&self) -> LinkProperties | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source. Read more
impl Debug for LinkProperties[src]
impl Debug for LinkPropertiesimpl Serialize for LinkProperties[src]
impl Serialize for LinkPropertiesfn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where | [src] |
impl<'de> Deserialize<'de> for LinkProperties[src]
impl<'de> Deserialize<'de> for LinkPropertiesfn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where | [src] |
Auto Trait Implementations
impl Send for LinkProperties
impl Send for LinkPropertiesimpl Sync for LinkProperties
impl Sync for LinkPropertiesBlanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId | [src] |
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,