pub struct Synchronize {
pub fork: u64,
pub length: u64,
pub remote_length: u64,
pub downloading: bool,
pub uploading: bool,
pub can_upgrade: bool,
}Expand description
Synchronize message. Type 0.
Fields§
§fork: u64Fork id, set to 0 for an un-forked hypercore.
length: u64Length of hypercore
remote_length: u64Known length of the remote party, 0 for unknown.
downloading: boolDownloading allowed
uploading: boolUploading allowed
can_upgrade: boolUpgrade possible
Trait Implementations§
Source§impl Clone for Synchronize
impl Clone for Synchronize
Source§fn clone(&self) -> Synchronize
fn clone(&self) -> Synchronize
Returns a duplicate 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 CompactEncoding for Synchronize
impl CompactEncoding for Synchronize
Source§fn encoded_size(&self) -> Result<usize, EncodingError>
fn encoded_size(&self) -> Result<usize, EncodingError>
The size in bytes required to encode
self.Source§fn encode<'a>(
&self,
buffer: &'a mut [u8],
) -> Result<&'a mut [u8], EncodingError>
fn encode<'a>( &self, buffer: &'a mut [u8], ) -> Result<&'a mut [u8], EncodingError>
Encode
self into buffer returning the remainder of buffer.Source§fn decode(buffer: &[u8]) -> Result<(Self, &[u8]), EncodingError>where
Self: Sized,
fn decode(buffer: &[u8]) -> Result<(Self, &[u8]), EncodingError>where
Self: Sized,
Decode a value from the given
buffer of the type specified by the Decode type parameter
(which defaults to Self). Returns the decoded value and remaining undecoded bytes.Source§fn to_encoded_bytes(&self) -> Result<Box<[u8]>, EncodingError>
fn to_encoded_bytes(&self) -> Result<Box<[u8]>, EncodingError>
Encode
self into a Vec<u8>. This is just a helper method for creating a buffer and
encoding to it in one step. Read moreSource§fn create_buffer(&self) -> Result<Box<[u8]>, EncodingError>
fn create_buffer(&self) -> Result<Box<[u8]>, EncodingError>
Create an empty buffer of the correct size for encoding
self to. This is just a helper
method for: encoding to it in one step. Read moreSource§fn encode_with_len<'a>(
&self,
buffer: &'a mut [u8],
) -> Result<(&'a mut [u8], usize), EncodingError>
fn encode_with_len<'a>( &self, buffer: &'a mut [u8], ) -> Result<(&'a mut [u8], usize), EncodingError>
Like
CompactEncoding::encode but also return the number of bytes encoded.Source§fn decode_with_len(
buffer: &[u8],
) -> Result<(Decode, &[u8], usize), EncodingError>
fn decode_with_len( buffer: &[u8], ) -> Result<(Decode, &[u8], usize), EncodingError>
Like
CompactEncoding::decode but also return the number of bytes decoded.Source§impl Debug for Synchronize
impl Debug for Synchronize
Source§impl From<Synchronize> for Message
impl From<Synchronize> for Message
Source§fn from(value: Synchronize) -> Self
fn from(value: Synchronize) -> Self
Converts to this type from the input type.
Source§impl PartialEq for Synchronize
impl PartialEq for Synchronize
impl StructuralPartialEq for Synchronize
Auto Trait Implementations§
impl Freeze for Synchronize
impl RefUnwindSafe for Synchronize
impl Send for Synchronize
impl Sync for Synchronize
impl Unpin for Synchronize
impl UnsafeUnpin for Synchronize
impl UnwindSafe for Synchronize
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