pub struct BitsPerSec<T: Prefix> {
pub value: u64,
pub prefix: T,
}
Expand description
A throughput in bits-per-second.
Fields§
§value: u64
§prefix: T
Implementations§
Trait Implementations§
source§impl<T: Clone + Prefix> Clone for BitsPerSec<T>
impl<T: Clone + Prefix> Clone for BitsPerSec<T>
source§fn clone(&self) -> BitsPerSec<T>
fn clone(&self) -> BitsPerSec<T>
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<T: Prefix> Default for BitsPerSec<T>
impl<T: Prefix> Default for BitsPerSec<T>
source§impl<'de, T: Prefix> Deserialize<'de> for BitsPerSec<T>
impl<'de, T: Prefix> Deserialize<'de> for BitsPerSec<T>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: Prefix> Display for BitsPerSec<T>
impl<T: Prefix> Display for BitsPerSec<T>
source§impl<T: Prefix> FromStr for BitsPerSec<T>
impl<T: Prefix> FromStr for BitsPerSec<T>
source§impl<T: Prefix> JsonSchema for BitsPerSec<T>
impl<T: Prefix> JsonSchema for BitsPerSec<T>
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§impl<T: Prefix> Serialize for BitsPerSec<T>
impl<T: Prefix> Serialize for BitsPerSec<T>
source§impl<T: Prefix> Unit for BitsPerSec<T>
impl<T: Prefix> Unit for BitsPerSec<T>
type U = u64
type T = T
fn suffixes() -> &'static [&'static str]
source§fn convert(&self, prefix: Self::T) -> Result<Self, String>
fn convert(&self, prefix: Self::T) -> Result<Self, String>
Convert value to a different prefix, but return an error if the conversion
cannot be done without possibly losing precision.
source§fn convert_lossy(&self, prefix: Self::T) -> Self
fn convert_lossy(&self, prefix: Self::T) -> Self
Convert value to a different prefix, even if it loses precision.
impl<T: Copy + Prefix> Copy for BitsPerSec<T>
impl<T: Eq + Prefix> Eq for BitsPerSec<T>
impl<T: Prefix> StructuralPartialEq for BitsPerSec<T>
Auto Trait Implementations§
impl<T> Freeze for BitsPerSec<T>where
T: Freeze,
impl<T> RefUnwindSafe for BitsPerSec<T>where
T: RefUnwindSafe,
impl<T> Send for BitsPerSec<T>where
T: Send,
impl<T> Sync for BitsPerSec<T>where
T: Sync,
impl<T> Unpin for BitsPerSec<T>where
T: Unpin,
impl<T> UnwindSafe for BitsPerSec<T>where
T: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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 more