pub struct SerializableChunks<N, Ch, B>{
pub compressed_chunks: Vec<(ChunkKey<N>, Compressed<BincodeCompression<Ch, B>>)>,
}Expand description
A simple format for serializing a collection of chunks. All chunks are serialized with bincode, then compressed using some
BytesCompression.
Fields§
§compressed_chunks: Vec<(ChunkKey<N>, Compressed<BincodeCompression<Ch, B>>)>Implementations§
Source§impl<N, Ch, B> SerializableChunks<N, Ch, B>
impl<N, Ch, B> SerializableChunks<N, Ch, B>
Sourcepub async fn from_iter(
compression: BincodeCompression<Ch, B>,
chunks_iter: impl IntoIterator<Item = (ChunkKey<N>, Ch)>,
) -> SerializableChunks<N, Ch, B>where
B: Copy,
pub async fn from_iter(
compression: BincodeCompression<Ch, B>,
chunks_iter: impl IntoIterator<Item = (ChunkKey<N>, Ch)>,
) -> SerializableChunks<N, Ch, B>where
B: Copy,
Returns a serializable version of this collection of chunks. All chunks are serialized with bincode, then compressed
using some B: BytesCompression. This can be used to serialize any kind of ChunkMap, regardless of chunk storage.
Sourcepub async fn fill_storage<Store>(self, storage: &mut Store)where
Store: ChunkWriteStorage<N, Ch>,
pub async fn fill_storage<Store>(self, storage: &mut Store)where
Store: ChunkWriteStorage<N, Ch>,
Fills storage from the serialized, compressed chunks. This will decompress each chunk and insert it into the given
storage.
Trait Implementations§
Source§impl<'de, N, Ch, B> Deserialize<'de> for SerializableChunks<N, Ch, B>
impl<'de, N, Ch, B> Deserialize<'de> for SerializableChunks<N, Ch, B>
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SerializableChunks<N, Ch, B>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SerializableChunks<N, Ch, B>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<N, Ch, B> Serialize for SerializableChunks<N, Ch, B>where
N: DeserializeOwned + Serialize,
Ch: DeserializeOwned + Serialize,
B: BytesCompression + Serialize,
impl<N, Ch, B> Serialize for SerializableChunks<N, Ch, B>where
N: DeserializeOwned + Serialize,
Ch: DeserializeOwned + Serialize,
B: BytesCompression + Serialize,
Source§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
Auto Trait Implementations§
impl<N, Ch, B> Freeze for SerializableChunks<N, Ch, B>
impl<N, Ch, B> RefUnwindSafe for SerializableChunks<N, Ch, B>
impl<N, Ch, B> Send for SerializableChunks<N, Ch, B>
impl<N, Ch, B> Sync for SerializableChunks<N, Ch, B>
impl<N, Ch, B> Unpin for SerializableChunks<N, Ch, B>
impl<N, Ch, B> UnwindSafe for SerializableChunks<N, Ch, B>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.