activitystreams/src/link/types.rs

41 lines
1.3 KiB
Rust
Raw Normal View History

2018-05-12 20:14:43 +00:00
/*
2020-03-11 14:56:36 +00:00
* This file is part of ActivityStreams.
2018-05-12 20:14:43 +00:00
*
2020-03-10 19:55:15 +00:00
* Copyright © 2020 Riley Trautman
2018-05-12 20:14:43 +00:00
*
2020-03-11 14:56:36 +00:00
* ActivityStreams is free software: you can redistribute it and/or modify
2018-05-12 20:14:43 +00:00
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
2020-03-11 14:56:36 +00:00
* ActivityStreams is distributed in the hope that it will be useful,
2018-05-12 20:14:43 +00:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2020-03-11 14:56:36 +00:00
* along with ActivityStreams. If not, see <http://www.gnu.org/licenses/>.
2018-05-12 20:14:43 +00:00
*/
2020-03-11 14:56:36 +00:00
use crate::{
link::{kind::*, properties::*, Link, LinkBox},
2020-03-18 22:47:56 +00:00
Base, BaseBox, PropRefs,
};
2018-05-12 05:31:33 +00:00
2020-03-11 16:17:40 +00:00
#[cfg(feature = "types")]
/// A specialized Link that represents an @mention.
2020-03-18 22:36:16 +00:00
#[derive(Clone, Debug, Default, PropRefs, serde::Deserialize, serde::Serialize)]
2018-05-12 05:31:33 +00:00
#[serde(rename_all = "camelCase")]
#[prop_refs(Link)]
2020-03-11 16:17:40 +00:00
pub struct Mention {
2018-05-12 05:31:33 +00:00
#[serde(rename = "type")]
#[serde(alias = "objectType")]
#[serde(alias = "verb")]
2020-03-11 16:17:40 +00:00
kind: MentionType,
2020-03-11 16:17:40 +00:00
/// Adds all valid link properties to this struct
2018-05-12 05:31:33 +00:00
#[serde(flatten)]
#[prop_refs]
2020-03-11 16:17:40 +00:00
pub link_props: LinkProperties,
2018-05-12 05:31:33 +00:00
}