pub struct StringLimitsBuilder<R, Q = u64>where
Q: ResourceQuantity,{ /* private fields */ }Expand description
Builder for StringLimits.
§Type Parameters
R- Caller-defined resource identity retained by limits and errors.Q- Exact unsigned quantity used for measurements and accounting.
§Examples
use qubit_budget::ResourceLimit;
use qubit_budget::StringLimitsBuilder;
let limits = StringLimitsBuilder::new()
.utf8_bytes_limit(ResourceLimit::new("string bytes", 4_u64))
.build();
assert_eq!(limits.utf8_bytes_limit().unwrap().maximum(), 4);Implementations§
Source§impl<R, Q> StringLimitsBuilder<R, Q>where
Q: ResourceQuantity,
impl<R, Q> StringLimitsBuilder<R, Q>where
Q: ResourceQuantity,
Sourcepub fn utf8_bytes_limit(self, limit: ResourceLimit<R, Q>) -> Self
pub fn utf8_bytes_limit(self, limit: ResourceLimit<R, Q>) -> Self
Sourcepub fn build(self) -> StringLimits<R, Q>
pub fn build(self) -> StringLimits<R, Q>
Trait Implementations§
Source§impl<R: Clone, Q> Clone for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + Clone,
impl<R: Clone, Q> Clone for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + Clone,
Source§fn clone(&self) -> StringLimitsBuilder<R, Q>
fn clone(&self) -> StringLimitsBuilder<R, Q>
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 moreimpl<R: Copy, Q> Copy for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + Copy,
Source§impl<R: Debug, Q> Debug for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + Debug,
impl<R: Debug, Q> Debug for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + Debug,
Source§impl<R, Q> Default for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity,
impl<R, Q> Default for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity,
impl<R: Eq, Q> Eq for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + Eq,
Source§impl<R: Hash, Q> Hash for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + Hash,
impl<R: Hash, Q> Hash for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + Hash,
Source§impl<R: PartialEq, Q> PartialEq for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + PartialEq,
impl<R: PartialEq, Q> PartialEq for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + PartialEq,
impl<R: PartialEq, Q> StructuralPartialEq for StringLimitsBuilder<R, Q>where
Q: ResourceQuantity + PartialEq,
Auto Trait Implementations§
impl<R, Q> Freeze for StringLimitsBuilder<R, Q>where
StringLimits<R, Q>: Freeze,
impl<R, Q> RefUnwindSafe for StringLimitsBuilder<R, Q>where
StringLimits<R, Q>: RefUnwindSafe,
impl<R, Q> Send for StringLimitsBuilder<R, Q>where
StringLimits<R, Q>: Send,
impl<R, Q> Sync for StringLimitsBuilder<R, Q>where
StringLimits<R, Q>: Sync,
impl<R, Q> Unpin for StringLimitsBuilder<R, Q>where
StringLimits<R, Q>: Unpin,
impl<R, Q> UnsafeUnpin for StringLimitsBuilder<R, Q>where
StringLimits<R, Q>: UnsafeUnpin,
impl<R, Q> UnwindSafe for StringLimitsBuilder<R, Q>where
StringLimits<R, Q>: UnwindSafe,
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