Struct ruma::push::RoomMemberCountIs [−][src]
pub struct RoomMemberCountIs {
pub prefix: ComparisonOperator,
pub count: UInt,
}
Expand description
A decimal integer optionally prefixed by one of ==
, <
, >
, >=
or <=
.
A prefix of <
matches rooms where the member count is strictly less than the given
number and so forth. If no prefix is present, this parameter defaults to ==
.
Can be constructed from a number or a range:
use js_int::uint;
use ruma_common::push::RoomMemberCountIs;
// equivalent to `is: "3"` or `is: "==3"`
let exact = RoomMemberCountIs::from(uint!(3));
// equivalent to `is: ">=3"`
let greater_or_equal = RoomMemberCountIs::from(uint!(3)..);
// equivalent to `is: "<3"`
let less = RoomMemberCountIs::from(..uint!(3));
// equivalent to `is: "<=3"`
let less_or_equal = RoomMemberCountIs::from(..=uint!(3));
// An exclusive range can be constructed with `RoomMemberCountIs::gt`:
// (equivalent to `is: ">3"`)
let greater = RoomMemberCountIs::gt(uint!(3));
Fields
prefix: ComparisonOperator
One of ==
, <
, >
, >=
, <=
, or no prefix.
count: UInt
The number of people in the room.
Implementations
Creates an instance of RoomMemberCount
equivalent to <X
,
where X is the specified member count.
Trait Implementations
pub fn deserialize<D>(
deserializer: D
) -> Result<RoomMemberCountIs, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<RoomMemberCountIs, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
type Err = ParseIntError
type Err = ParseIntError
The associated error which can be returned from parsing.
Parses a string s
to return a value of this type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Start index bound. Read more
1.35.0[src]fn contains<U>(&self, item: &U) -> bool where
T: PartialOrd<U>,
U: PartialOrd<T> + ?Sized,
fn contains<U>(&self, item: &U) -> bool where
T: PartialOrd<U>,
U: PartialOrd<T> + ?Sized,
Returns true
if item
is contained in the range. Read more
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub 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 RefUnwindSafe for RoomMemberCountIs
impl Send for RoomMemberCountIs
impl Sync for RoomMemberCountIs
impl Unpin for RoomMemberCountIs
impl UnwindSafe for RoomMemberCountIs
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more