pub struct Filter {
pub id: FilterId,
pub title: String,
pub context: Vec<FilterContext>,
pub expires_at: Option<OffsetDateTime>,
pub filter_action: Action,
pub keywords: Vec<Keyword>,
pub statuses: Vec<Status>,
}Expand description
Represents a user-defined filter for determining which statuses should not be shown to the user.
§Example
use mastodon_async_entities::prelude::*;
let subject = r#"{
"id": "19972",
"title": "Test filter",
"context": [
"home"
],
"expires_at": "2022-09-20T17:27:39.296Z",
"filter_action": "warn",
"keywords": [
{
"id": "1197",
"keyword": "bad word",
"whole_word": false
}
],
"statuses": [
{
"id": "1",
"status_id": "109031743575371913"
}
]
}"#;
let subject: Filter = serde_json::from_str(subject).expect("deserialize");
assert_eq!(subject.id, FilterId::new("19972"));Fields§
§id: FilterIdThe ID of the Filter in the database.
title: StringA title given by the user to name the filter.
context: Vec<FilterContext>The contexts in which the filter should be applied.
expires_at: Option<OffsetDateTime>When the filter should no longer be applied.
filter_action: ActionThe action to be taken when a status matches this filter.
keywords: Vec<Keyword>The keywords grouped under this filter.
statuses: Vec<Status>The statuses grouped under this filter.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Filter
impl<'de> Deserialize<'de> for Filter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Filter
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnwindSafe for Filter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more