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 more