pub struct NormalizedWeight;Expand description
Witness credential for a single normalized weight.
Created via NormalizedWeight::from_normalized_container, which
binary-searches a validated sorted container to confirm membership.
ⓘ
let set = NormalizedContainer::witness(weights)?;
let w = 0.3_f64.witness().by(
|v| NormalizedWeight::from_normalized_container(*v, &set)
)?;Implementations§
Source§impl NormalizedWeight
impl NormalizedWeight
Sourcepub fn from_normalized_container<T: Float>(
value: T,
container: &Witnessed<Vec<T>, NormalizedContainer>,
) -> Result<Self, &'static str>
pub fn from_normalized_container<T: Float>( value: T, container: &Witnessed<Vec<T>, NormalizedContainer>, ) -> Result<Self, &'static str>
Verify value is a member of a validated normalized set.
Binary-searches the sorted container.
Auto Trait Implementations§
impl Freeze for NormalizedWeight
impl RefUnwindSafe for NormalizedWeight
impl Send for NormalizedWeight
impl Sync for NormalizedWeight
impl Unpin for NormalizedWeight
impl UnsafeUnpin for NormalizedWeight
impl UnwindSafe for NormalizedWeight
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