#[non_exhaustive]pub struct RequiredStateElement {
pub event_type: Option<StateEventType>,
pub state_key: Option<String>,
}Available on crate feature
api and crate feature unstable-msc4186 and (crate features client-api-c or client-api-s) and (crate features client or server) only.Expand description
A matcher for state events (see RequiredState).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.event_type: Option<StateEventType>The event type to match.
None matches all types.
state_key: Option<String>The state key to match.
None matches all state keys.
Implementations§
Source§impl RequiredStateElement
impl RequiredStateElement
Sourcepub fn new() -> RequiredStateElement
pub fn new() -> RequiredStateElement
Creates a RequiredStateElement that matches all state events.
Sourcepub fn with_event_type(self, event_type: StateEventType) -> RequiredStateElement
pub fn with_event_type(self, event_type: StateEventType) -> RequiredStateElement
Only match state events with the given event type.
Sourcepub fn with_state_key(self, state_key: String) -> RequiredStateElement
pub fn with_state_key(self, state_key: String) -> RequiredStateElement
Only match state events with the given state key.
Trait Implementations§
Source§impl Clone for RequiredStateElement
impl Clone for RequiredStateElement
Source§fn clone(&self) -> RequiredStateElement
fn clone(&self) -> RequiredStateElement
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequiredStateElement
impl Debug for RequiredStateElement
Source§impl Default for RequiredStateElement
impl Default for RequiredStateElement
Source§fn default() -> RequiredStateElement
fn default() -> RequiredStateElement
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RequiredStateElement
impl<'de> Deserialize<'de> for RequiredStateElement
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RequiredStateElement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RequiredStateElement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for RequiredStateElement
impl Serialize for RequiredStateElement
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Forget for RequiredStateElement
impl Freeze for RequiredStateElement
impl Move for RequiredStateElement
impl RefUnwindSafe for RequiredStateElement
impl Send for RequiredStateElement
impl Sync for RequiredStateElement
impl Unpin for RequiredStateElement
impl UnsafeUnpin for RequiredStateElement
impl UnwindSafe for RequiredStateElement
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