Add AsApActor, Actor impls for ApObject

This commit is contained in:
asonix 2020-11-24 10:23:33 -06:00
parent 767a70ba97
commit b99daa1e1d
4 changed files with 22 additions and 2 deletions

View file

@ -1,3 +1,8 @@
# Unreleased
# 0.7.0-alpha.6
- Add Actor and AsApActor impls for ApObject
# 0.7.0-alpha.5 # 0.7.0-alpha.5
- Add orderedItems field to collections - Add orderedItems field to collections
- Document URL functions from crate root - Document URL functions from crate root

View file

@ -1,7 +1,7 @@
[package] [package]
name = "activitystreams" name = "activitystreams"
description = "A set of core types and traits for activitystreams data" description = "A set of core types and traits for activitystreams data"
version = "0.7.0-alpha.5" version = "0.7.0-alpha.6"
license = "GPL-3.0" license = "GPL-3.0"
authors = ["asonix <asonix@asonix.dog>"] authors = ["asonix <asonix@asonix.dog>"]
repository = "https://git.asonix.dog/Aardwolf/activitystreams" repository = "https://git.asonix.dog/Aardwolf/activitystreams"

View file

@ -11,7 +11,7 @@ _A set of Traits and Types that make up the ActivityStreams and ActivityPub spec
First, add ActivityStreams to your dependencies First, add ActivityStreams to your dependencies
```toml ```toml
[dependencies] [dependencies]
activitystreams = "0.7.0-alpha.4" activitystreams = "0.7.0-alpha.6"
``` ```
### Types ### Types

View file

@ -1504,6 +1504,8 @@ impl<Inner> markers::Base for ApActor<Inner> where Inner: markers::Base {}
impl<Inner> markers::Object for ApActor<Inner> where Inner: markers::Object {} impl<Inner> markers::Object for ApActor<Inner> where Inner: markers::Object {}
impl<Inner> markers::Actor for ApActor<Inner> where Inner: markers::Actor {} impl<Inner> markers::Actor for ApActor<Inner> where Inner: markers::Actor {}
impl<Inner> markers::Actor for ApObject<Inner> where Inner: markers::Actor {}
impl<Inner, Kind, Error> Extends<Kind> for ApActor<Inner> impl<Inner, Kind, Error> Extends<Kind> for ApActor<Inner>
where where
Inner: Extends<Kind, Error = Error> + UnparsedMut + markers::Actor, Inner: Extends<Kind, Error = Error> + UnparsedMut + markers::Actor,
@ -1622,3 +1624,16 @@ impl<Kind> AsObject<Kind> for Actor<Kind> {
} }
impl<T, Inner> ApActorExt<Inner> for T where T: AsApActor<Inner> {} impl<T, Inner> ApActorExt<Inner> for T where T: AsApActor<Inner> {}
impl<Inner1, Inner2> AsApActor<Inner2> for ApObject<Inner1>
where
Inner1: AsApActor<Inner2>,
{
fn ap_actor_ref(&self) -> &ApActor<Inner2> {
self.inner().ap_actor_ref()
}
fn ap_actor_mut(&mut self) -> &mut ApActor<Inner2> {
self.inner_mut().ap_actor_mut()
}
}