pub struct LifetimeLimits { /* private fields */ }api and crate feature unstable-msc1763 and (crate features client-api-c or client-api-s) and (crate features client or server) only.Expand description
Global limits for the per-room retention policy lifetimes.
Implementations§
Source§impl LifetimeLimits
impl LifetimeLimits
Sourcepub fn new() -> LifetimeLimits
pub fn new() -> LifetimeLimits
Create a new LifetimeLimits object with no limits set.
This method can be combined with the LifetimeLimits::at_least and
LifetimeLimits::at_most methods to configure the individual limits.
§Examples
let content = LifetimeLimits::new()
.at_least(Duration::from_hours(24))?
.at_most(Duration::from_hours(24 * 10))?;Sourcepub fn from_range(
lifetime_range: impl RangeBounds<Duration>,
) -> Option<LifetimeLimits>
pub fn from_range( lifetime_range: impl RangeBounds<Duration>, ) -> Option<LifetimeLimits>
Create a new LifetimeLimits object from a range.
Returns None if the duration of one of the limits, expressed as milliseconds, doesn’t
fall into the [0, (2^53)-1] range, or if the lower bound of the range is bigger than the
upper bound, i.e. 10..0.
§Examples
let content =
LifetimeLimits::from_range(Duration::from_hours(24)..Duration::from_hours(24 * 10))?;Sourcepub fn at_most(self, max: Duration) -> Option<LifetimeLimits>
pub fn at_most(self, max: Duration) -> Option<LifetimeLimits>
Sets the maximum value that a retention policy limit is allowed to have.
Returns None if the given limit, expressed as milliseconds, doesn’t fall into the [0,
(2^53)-1] range, or if the limits don’t adhere to the max < min constraint.
Sourcepub fn at_least(self, min: Duration) -> Option<LifetimeLimits>
pub fn at_least(self, min: Duration) -> Option<LifetimeLimits>
Sets the minimum value that a retention policy limit is allowed to have.
Returns None if the given limit, expressed as milliseconds, doesn’t fall into the [0,
(2^53)-1] range, or if the limits don’t adhere to the max < min constraint.
Trait Implementations§
Source§impl Clone for LifetimeLimits
impl Clone for LifetimeLimits
Source§fn clone(&self) -> LifetimeLimits
fn clone(&self) -> LifetimeLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LifetimeLimits
Source§impl Debug for LifetimeLimits
impl Debug for LifetimeLimits
Source§impl Default for LifetimeLimits
impl Default for LifetimeLimits
Source§fn default() -> LifetimeLimits
fn default() -> LifetimeLimits
Source§impl<'de> Deserialize<'de> for LifetimeLimits
impl<'de> Deserialize<'de> for LifetimeLimits
Source§fn deserialize<D>(
deserializer: D,
) -> Result<LifetimeLimits, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<LifetimeLimits, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Serialize for LifetimeLimits
impl Serialize for LifetimeLimits
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,
Auto Trait Implementations§
impl Freeze for LifetimeLimits
impl RefUnwindSafe for LifetimeLimits
impl Send for LifetimeLimits
impl Sync for LifetimeLimits
impl Unpin for LifetimeLimits
impl UnsafeUnpin for LifetimeLimits
impl UnwindSafe for LifetimeLimits
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more