Struct ruma_client_api::filter::FilterDefinition
source · #[non_exhaustive]pub struct FilterDefinition {
pub event_fields: Option<Vec<String>>,
pub event_format: EventFormat,
pub presence: Filter,
pub account_data: Filter,
pub room: RoomFilter,
}
Expand description
A filter definition
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.event_fields: Option<Vec<String>>
List of event fields to include.
If this list is absent then all fields are included. The entries may include ‘.’ characters to indicate sub-fields. So [‘content.body’] will include the ‘body’ field of the ‘content’ object. A literal ‘.’ or ’' character in a field name may be escaped using a ’'. A server may include more fields than were requested.
event_format: EventFormat
The format to use for events.
‘client’ will return the events in a format suitable for clients. ‘federation’ will return the raw event as received over federation. The default is ‘client’.
presence: Filter
The presence updates to include.
account_data: Filter
The user account data that isn’t associated with rooms to include.
room: RoomFilter
Filters to be applied to room data.
Implementations§
source§impl FilterDefinition
impl FilterDefinition
sourcepub fn empty() -> Self
pub fn empty() -> Self
Creates an empty FilterDefinition
.
You can also use the Default
implementation.
sourcepub fn ignore_all() -> Self
pub fn ignore_all() -> Self
Creates a new FilterDefinition
that can be used to ignore all events.
sourcepub fn with_lazy_loading() -> Self
pub fn with_lazy_loading() -> Self
Creates a new FilterDefinition
with room member lazy-loading enabled.
Redundant membership events are disabled.
Trait Implementations§
source§impl CanBeEmpty for FilterDefinition
impl CanBeEmpty for FilterDefinition
source§impl Clone for FilterDefinition
impl Clone for FilterDefinition
source§fn clone(&self) -> FilterDefinition
fn clone(&self) -> FilterDefinition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FilterDefinition
impl Debug for FilterDefinition
source§impl Default for FilterDefinition
impl Default for FilterDefinition
source§fn default() -> FilterDefinition
fn default() -> FilterDefinition
source§impl<'de> Deserialize<'de> for FilterDefinition
impl<'de> Deserialize<'de> for FilterDefinition
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>,
source§impl From<FilterDefinition> for Filter
impl From<FilterDefinition> for Filter
source§fn from(def: FilterDefinition) -> Self
fn from(def: FilterDefinition) -> Self
Auto Trait Implementations§
impl Freeze for FilterDefinition
impl RefUnwindSafe for FilterDefinition
impl Send for FilterDefinition
impl Sync for FilterDefinition
impl Unpin for FilterDefinition
impl UnwindSafe for FilterDefinition
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)