pub type OpHashSized = RoughSized<Arc<KitsuneOpHash, Global>>;
Expand description

An op hash combined with an approximate size of the op

Aliased Type§

struct OpHashSized { /* private fields */ }

Implementations§

§

impl<T> RoughSized<T>

pub fn new(data: T, size: Option<RoughInt>) -> RoughSized<T>

§

impl<T> RoughSized<T>

pub fn into_inner(self) -> (T, Option<RoughInt>)

Break into constituent parts

pub fn data_ref(&self) -> &T

Accessor

pub fn maybe_size(&self) -> Option<RoughInt>

Accessor

pub fn size(&self) -> RoughInt

Accessor

§

impl<T> RoughSized<T>where T: Clone,

pub fn data(&self) -> T

Accessor

Trait Implementations§

§

impl<T> Clone for RoughSized<T>where T: Clone,

§

fn clone(&self) -> RoughSized<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for RoughSized<T>where T: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Deref for RoughSized<T>

§

type Target = T

The resulting type after dereferencing.
§

fn deref(&self) -> &<RoughSized<T> as Deref>::Target

Dereferences the value.
§

impl<'de, T> Deserialize<'de> for RoughSized<T>where T: Deserialize<'de>,

§

fn deserialize<__D>( __deserializer: __D ) -> Result<RoughSized<T>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<T> From<(T, Option<RoughInt>)> for RoughSized<T>

§

fn from(original: (T, Option<RoughInt>)) -> RoughSized<T>

Converts to this type from the input type.
§

impl<T> Hash for RoughSized<T>where T: Hash,

§

fn hash<H>(&self, state: &mut H)where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<T> PartialEq<RoughSized<T>> for RoughSized<T>where T: PartialEq<T>,

§

fn eq(&self, other: &RoughSized<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> Serialize for RoughSized<T>where T: Serialize,

§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl<T> Eq for RoughSized<T>where T: Eq,