From efc6b49a9bc585fa99a72ede83f036e1a5ab3eb8 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 16 May 2020 11:14:03 -0500 Subject: [PATCH] Base doc fixes, Mention docs --- src/base.rs | 6 +++--- src/link.rs | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/base.rs b/src/base.rs index 60d5522..ba2c0cb 100644 --- a/src/base.rs +++ b/src/base.rs @@ -1405,7 +1405,7 @@ impl OneOrMany { self.one().and_then(|inner| inner.take_base()) } - /// Create a OneOrMany from an XsdAnyUri + /// Create a `OneOrMany` from an XsdAnyUri /// /// ```rust /// # fn main() -> Result<(), anyhow::Error> { @@ -1419,7 +1419,7 @@ impl OneOrMany { OneOrMany(Either::Left(AnyBase::from_xsd_any_uri(id))) } - /// Create a OneOrMany from an XsdString + /// Create a `OneOrMany` from an XsdString /// /// ```rust /// use activitystreams_new::{base::AnyBase, primitives::OneOrMany}; @@ -1430,7 +1430,7 @@ impl OneOrMany { OneOrMany(Either::Left(AnyBase::from_xsd_string(xsd_string))) } - /// Create a OneOrMany from a `Base` + /// Create a `OneOrMany` from a `Base` /// /// ```rust /// # use activitystreams_new::base::Base; diff --git a/src/link.rs b/src/link.rs index 0d42409..a83f57e 100644 --- a/src/link.rs +++ b/src/link.rs @@ -30,6 +30,11 @@ use std::convert::TryFrom; use typed_builder::TypedBuilder; pub mod kind { + //! kinds of links defined by the spec + //! + //! These types exist only to be statically-typed versions of the associated string. e.g. + //! `MentionType` -> `"Mention"` + pub use activitystreams::link::kind::MentionType; } @@ -459,6 +464,10 @@ pub trait LinkExt: AsLink { } } +/// The ActivityStreams Mention type +/// +/// This is just an alias for `Link` because there's no fields inherent to Mention +/// that aren't already present on a Link. pub type Mention = Link; /// Define all the properties of the Object base type as described by the Activity Streams