Struct ruma::push::RoomMemberCountIs
source · 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§
source§impl RoomMemberCountIs
impl RoomMemberCountIs
sourcepub fn gt(count: UInt) -> RoomMemberCountIs
Available on crate feature events
only.
pub fn gt(count: UInt) -> RoomMemberCountIs
events
only.Creates an instance of RoomMemberCount
equivalent to <X
,
where X is the specified member count.
Trait Implementations§
source§impl Clone for RoomMemberCountIs
impl Clone for RoomMemberCountIs
source§fn clone(&self) -> RoomMemberCountIs
fn clone(&self) -> RoomMemberCountIs
Returns a copy of the value. Read more
1.0.0 · 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 RoomMemberCountIs
impl Debug for RoomMemberCountIs
source§impl<'de> Deserialize<'de> for RoomMemberCountIs
impl<'de> Deserialize<'de> for RoomMemberCountIs
source§fn deserialize<D>(
deserializer: D,
) -> Result<RoomMemberCountIs, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
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
source§impl Display for RoomMemberCountIs
impl Display for RoomMemberCountIs
source§impl From<RangeToInclusive<UInt>> for RoomMemberCountIs
impl From<RangeToInclusive<UInt>> for RoomMemberCountIs
source§fn from(x: RangeToInclusive<UInt>) -> RoomMemberCountIs
fn from(x: RangeToInclusive<UInt>) -> RoomMemberCountIs
Converts to this type from the input type.
source§impl From<UInt> for RoomMemberCountIs
impl From<UInt> for RoomMemberCountIs
source§fn from(x: UInt) -> RoomMemberCountIs
fn from(x: UInt) -> RoomMemberCountIs
Converts to this type from the input type.
source§impl FromStr for RoomMemberCountIs
impl FromStr for RoomMemberCountIs
source§type Err = ParseIntError
type Err = ParseIntError
The associated error which can be returned from parsing.
source§fn from_str(
s: &str,
) -> Result<RoomMemberCountIs, <RoomMemberCountIs as FromStr>::Err>
fn from_str( s: &str, ) -> Result<RoomMemberCountIs, <RoomMemberCountIs as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moresource§impl PartialEq for RoomMemberCountIs
impl PartialEq for RoomMemberCountIs
source§impl RangeBounds<UInt> for RoomMemberCountIs
impl RangeBounds<UInt> for RoomMemberCountIs
source§impl Serialize for RoomMemberCountIs
impl Serialize for RoomMemberCountIs
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
impl Copy for RoomMemberCountIs
impl Eq for RoomMemberCountIs
impl StructuralPartialEq for RoomMemberCountIs
Auto Trait Implementations§
impl Freeze for RoomMemberCountIs
impl RefUnwindSafe for RoomMemberCountIs
impl Send for RoomMemberCountIs
impl Sync for RoomMemberCountIs
impl Unpin for RoomMemberCountIs
impl UnwindSafe for RoomMemberCountIs
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more