Struct prio::vidpf::VidpfWeight
source · pub struct VidpfWeight<F: FieldElement>(/* private fields */);
Available on crate features
crypto-dependencies
and experimental
only.Expand description
Represents an array of field elements that implements the VidpfValue
trait.
Trait Implementations§
source§impl<F: FieldElement> Add for VidpfWeight<F>
impl<F: FieldElement> Add for VidpfWeight<F>
source§impl<F: FieldElement> AddAssign for VidpfWeight<F>
impl<F: FieldElement> AddAssign for VidpfWeight<F>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Panics if weight lengths are different.
source§impl<F: Clone + FieldElement> Clone for VidpfWeight<F>
impl<F: Clone + FieldElement> Clone for VidpfWeight<F>
source§fn clone(&self) -> VidpfWeight<F>
fn clone(&self) -> VidpfWeight<F>
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<F: FieldElement> ConditionallyNegatable for VidpfWeight<F>
impl<F: FieldElement> ConditionallyNegatable for VidpfWeight<F>
source§fn conditional_negate(&mut self, choice: Choice)
fn conditional_negate(&mut self, choice: Choice)
source§impl<F: Debug + FieldElement> Debug for VidpfWeight<F>
impl<F: Debug + FieldElement> Debug for VidpfWeight<F>
source§impl<F: FieldElement> Encode for VidpfWeight<F>
impl<F: FieldElement> Encode for VidpfWeight<F>
source§fn encode(&self, bytes: &mut Vec<u8>) -> Result<(), CodecError>
fn encode(&self, bytes: &mut Vec<u8>) -> Result<(), CodecError>
Append the encoded form of this object to the end of
bytes
, growing the vector as needed.source§fn encoded_len(&self) -> Option<usize>
fn encoded_len(&self) -> Option<usize>
Returns an optional hint indicating how many bytes will be required to encode this value, or
None
by default.source§fn get_encoded(&self) -> Result<Vec<u8>, CodecError>
fn get_encoded(&self) -> Result<Vec<u8>, CodecError>
Convenience method to encode a value into a new
Vec<u8>
.source§impl<F: FieldElement> From<Vec<F>> for VidpfWeight<F>
impl<F: FieldElement> From<Vec<F>> for VidpfWeight<F>
source§impl<F: FieldElement> IdpfValue for VidpfWeight<F>
impl<F: FieldElement> IdpfValue for VidpfWeight<F>
§type ValueParameter = usize
type ValueParameter = usize
The parameter determines the number of field elements in the vector.
source§fn conditional_select(lhs: &Self, rhs: &Self, choice: Choice) -> Self
fn conditional_select(lhs: &Self, rhs: &Self, choice: Choice) -> Self
Panics if weight lengths are different.
source§fn generate<S: RngCore>(
seed_stream: &mut S,
length: &Self::ValueParameter
) -> Self
fn generate<S: RngCore>( seed_stream: &mut S, length: &Self::ValueParameter ) -> Self
Generate a pseudorandom value from a seed stream.
source§fn zero(length: &Self::ValueParameter) -> Self
fn zero(length: &Self::ValueParameter) -> Self
Returns the additive identity.
source§impl<F: FieldElement> ParameterizedDecode<<VidpfWeight<F> as IdpfValue>::ValueParameter> for VidpfWeight<F>
impl<F: FieldElement> ParameterizedDecode<<VidpfWeight<F> as IdpfValue>::ValueParameter> for VidpfWeight<F>
source§fn decode_with_param(
decoding_parameter: &<Self as IdpfValue>::ValueParameter,
bytes: &mut Cursor<&[u8]>
) -> Result<Self, CodecError>
fn decode_with_param( decoding_parameter: &<Self as IdpfValue>::ValueParameter, bytes: &mut Cursor<&[u8]> ) -> Result<Self, CodecError>
Read and decode an encoded object from
bytes
. decoding_parameter
provides details of the
wire encoding such as lengths of different portions of the message. On success, the decoded
value is returned and bytes
is advanced by the encoded size of the value. On failure, an
error is returned and no further attempt to read from bytes
should be made.source§fn get_decoded_with_param(
decoding_parameter: &P,
bytes: &[u8]
) -> Result<Self, CodecError>
fn get_decoded_with_param( decoding_parameter: &P, bytes: &[u8] ) -> Result<Self, CodecError>
Convenience method to get a decoded value. Returns an error if
Self::decode_with_param
fails, or if there are any bytes left in bytes
after decoding a value.source§impl<F: PartialEq + FieldElement> PartialEq for VidpfWeight<F>
impl<F: PartialEq + FieldElement> PartialEq for VidpfWeight<F>
source§fn eq(&self, other: &VidpfWeight<F>) -> bool
fn eq(&self, other: &VidpfWeight<F>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<F: FieldElement> Sub for VidpfWeight<F>
impl<F: FieldElement> Sub for VidpfWeight<F>
impl<F: Eq + FieldElement> Eq for VidpfWeight<F>
impl<F: FieldElement> StructuralPartialEq for VidpfWeight<F>
impl<F: FieldElement> VidpfValue for VidpfWeight<F>
Auto Trait Implementations§
impl<F> Freeze for VidpfWeight<F>
impl<F> RefUnwindSafe for VidpfWeight<F>where
F: RefUnwindSafe,
impl<F> Send for VidpfWeight<F>where
F: Send,
impl<F> Sync for VidpfWeight<F>where
F: Sync,
impl<F> Unpin for VidpfWeight<F>where
F: Unpin,
impl<F> UnwindSafe for VidpfWeight<F>where
F: 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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.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 moresource§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<E, T> ParameterizedEncode<T> for E
impl<E, T> ParameterizedEncode<T> for E
source§fn encode_with_param(
&self,
_encoding_parameter: &T,
bytes: &mut Vec<u8>
) -> Result<(), CodecError>
fn encode_with_param( &self, _encoding_parameter: &T, bytes: &mut Vec<u8> ) -> Result<(), CodecError>
Append the encoded form of this object to the end of
bytes
, growing the vector as needed.
encoding_parameter
provides details of the wire encoding, used to control how the value
is encoded.source§fn encoded_len_with_param(&self, _encoding_parameter: &T) -> Option<usize>
fn encoded_len_with_param(&self, _encoding_parameter: &T) -> Option<usize>
Returns an optional hint indicating how many bytes will be required to encode this value, or
None
by default.source§fn get_encoded_with_param(
&self,
encoding_parameter: &P
) -> Result<Vec<u8>, CodecError>
fn get_encoded_with_param( &self, encoding_parameter: &P ) -> Result<Vec<u8>, CodecError>
Convenience method to encode a value into a new
Vec<u8>
.source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.