astreams
: Move StreamsEntity
impls to the right place
This commit is contained in:
parent
03a6cf4fda
commit
4389ace574
3 changed files with 16 additions and 16 deletions
|
@ -240,11 +240,23 @@ impl StreamsJsonLD<json_ld::Node> for json_ld::Node {
|
|||
}
|
||||
|
||||
impl StreamsEntity<json_ld::Node> for json_ld::Node {
|
||||
fn activitystreams_names(&self) -> impl Iterator<Item = AResult<LangTriple>> {
|
||||
self.jsonld_iter_value_langstring(
|
||||
iri!("https://www.w3.org/ns/activitystreams#name")
|
||||
)
|
||||
}
|
||||
|
||||
fn activitystreams_previews(&self) -> impl Iterator<Item = AResult<json_ld::Node>> {
|
||||
self.jsonld_iter_node_entity(
|
||||
iri!("https://www.w3.org/ns/activitystreams#preview")
|
||||
)
|
||||
}
|
||||
|
||||
fn activitystreams_mediatype(&self) -> Option<AResult<MediaType>> {
|
||||
self.jsonld_any_value_mediatype(
|
||||
iri!("https://www.w3.org/ns/activitystreams#mediaType")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl StreamsLink<json_ld::Node> for json_ld::Node {
|
||||
|
@ -260,18 +272,6 @@ impl StreamsLink<json_ld::Node> for json_ld::Node {
|
|||
)
|
||||
}
|
||||
|
||||
fn activitystreams_mediatype(&self) -> Option<AResult<MediaType>> {
|
||||
self.jsonld_any_value_mediatype(
|
||||
iri!("https://www.w3.org/ns/activitystreams#mediaType")
|
||||
)
|
||||
}
|
||||
|
||||
fn activitystreams_names(&self) -> impl Iterator<Item = AResult<LangTriple>> {
|
||||
self.jsonld_iter_value_langstring(
|
||||
iri!("https://www.w3.org/ns/activitystreams#name")
|
||||
)
|
||||
}
|
||||
|
||||
fn activitystreams_hreflang(&self) -> Option<AResult<LangTagBuf>> {
|
||||
self.jsonld_any_value_langtag(
|
||||
iri!("https://www.w3.org/ns/activitystreams#hreflang")
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
//!
|
||||
|
||||
use anyhow::Result as AResult;
|
||||
use chrono::{DateTime, Local, TimeDelta, Timelike};
|
||||
use chrono::{DateTime, Local, TimeDelta};
|
||||
use json_ld::Direction;
|
||||
use json_ld::syntax::LangTagBuf;
|
||||
use mediatype::MediaType;
|
||||
|
|
|
@ -259,7 +259,7 @@ async fn test_link_media_type() {
|
|||
.expect("Main node was not found");
|
||||
|
||||
let mediatype = {
|
||||
use acrate_astreams::activitystreams::StreamsLink;
|
||||
use acrate_astreams::activitystreams::StreamsEntity;
|
||||
|
||||
node.activitystreams_mediatype()
|
||||
.expect("Property `mediaType` was not found")
|
||||
|
@ -277,7 +277,7 @@ async fn test_link_name_value() {
|
|||
.expect("Main node was not found");
|
||||
|
||||
let names: Vec<LangTriple> = {
|
||||
use acrate_astreams::activitystreams::StreamsLink;
|
||||
use acrate_astreams::activitystreams::StreamsEntity;
|
||||
|
||||
node.activitystreams_names()
|
||||
.map(|v| v
|
||||
|
@ -302,7 +302,7 @@ async fn test_link_name_lang() {
|
|||
.expect("Main node was not found");
|
||||
|
||||
let names: Vec<LangTriple> = {
|
||||
use acrate_astreams::activitystreams::StreamsLink;
|
||||
use acrate_astreams::activitystreams::StreamsEntity;
|
||||
|
||||
node.activitystreams_names()
|
||||
.map(|v| v
|
||||
|
|
Loading…
Add table
Reference in a new issue