Struct holochain::prelude::dependencies::kitsune_p2p_fetch::RoughSized
pub struct RoughSized<T> { /* private fields */ }
Expand description
Some data which has a RoughInt assigned for its size
Implementations§
§impl<T> RoughSized<T>
impl<T> RoughSized<T>
pub fn new(data: T, size: Option<RoughInt>) -> RoughSized<T>
§impl<T> RoughSized<T>
impl<T> RoughSized<T>
pub fn into_inner(self) -> (T, Option<RoughInt>)
pub fn into_inner(self) -> (T, Option<RoughInt>)
Break into constituent parts
pub fn maybe_size(&self) -> Option<RoughInt>
pub fn maybe_size(&self) -> Option<RoughInt>
Accessor
§impl<T> RoughSized<T>where
T: Clone,
impl<T> RoughSized<T>where
T: Clone,
pub fn data(&self) -> T
pub fn data(&self) -> T
Accessor
Trait Implementations§
§impl<T> Clone for RoughSized<T>where
T: Clone,
impl<T> Clone for RoughSized<T>where
T: Clone,
§fn clone(&self) -> RoughSized<T>
fn clone(&self) -> RoughSized<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 more§impl<T> Debug for RoughSized<T>where
T: Debug,
impl<T> Debug for RoughSized<T>where
T: Debug,
§impl<T> Deref for RoughSized<T>
impl<T> Deref for RoughSized<T>
§impl<'de, T> Deserialize<'de> for RoughSized<T>where
T: Deserialize<'de>,
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>,
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>
impl<T> From<(T, Option<RoughInt>)> for RoughSized<T>
§fn from(original: (T, Option<RoughInt>)) -> RoughSized<T>
fn from(original: (T, Option<RoughInt>)) -> RoughSized<T>
Converts to this type from the input type.
§impl<T> From<RoughSized<T>> for (T, Option<RoughInt>)
impl<T> From<RoughSized<T>> for (T, Option<RoughInt>)
§fn from(original: RoughSized<T>) -> (T, Option<RoughInt>)
fn from(original: RoughSized<T>) -> (T, Option<RoughInt>)
Converts to this type from the input type.
§impl<T> Hash for RoughSized<T>where
T: Hash,
impl<T> Hash for RoughSized<T>where
T: Hash,
§impl<T> PartialEq<RoughSized<T>> for RoughSized<T>where
T: PartialEq<T>,
impl<T> PartialEq<RoughSized<T>> for RoughSized<T>where
T: PartialEq<T>,
§fn eq(&self, other: &RoughSized<T>) -> bool
fn eq(&self, other: &RoughSized<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl<T> Serialize for RoughSized<T>where
T: Serialize,
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,
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,
Auto Trait Implementations§
impl<T> RefUnwindSafe for RoughSized<T>where
T: RefUnwindSafe,
impl<T> Send for RoughSized<T>where
T: Send,
impl<T> Sync for RoughSized<T>where
T: Sync,
impl<T> Unpin for RoughSized<T>where
T: Unpin,
impl<T> UnwindSafe for RoughSized<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove
Any::type_id_compat and use StdAny::type_id instead.
https://github.com/rust-lang/rust/issues/27745
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref