pub struct ObjectMutBody<B, O>where
O: ObjectType,
B: BodyContent,{ /* private fields */ }
Implementations§
Source§impl<B, O> ObjectMutBody<B, O>where
B: BodyContent,
O: ObjectType,
impl<B, O> ObjectMutBody<B, O>where
B: BodyContent,
O: ObjectType,
pub fn prev_version(&self) -> &Option<HashValue>
pub fn update_time(&self) -> u64
pub fn content(&self) -> &B
pub fn into_content(self) -> B
pub fn user_data(&self) -> &Option<Vec<u8>>
pub fn set_update_time(&mut self, value: u64)
pub fn increase_update_time(&mut self, value: u64)
pub fn content_mut(&mut self) -> &mut B
pub fn set_userdata(&mut self, user_data: &[u8])
Source§impl<B, O> ObjectMutBody<B, O>
impl<B, O> ObjectMutBody<B, O>
pub fn calculate_hash(&self) -> BuckyResult<HashValue>
Trait Implementations§
Source§impl<B, O> Clone for ObjectMutBody<B, O>
impl<B, O> Clone for ObjectMutBody<B, O>
Source§fn clone(&self) -> ObjectMutBody<B, O>
fn clone(&self) -> ObjectMutBody<B, O>
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<B, O> Debug for ObjectMutBody<B, O>
impl<B, O> Debug for ObjectMutBody<B, O>
Source§impl<'de, B, O> Default for ObjectMutBody<B, O>
impl<'de, B, O> Default for ObjectMutBody<B, O>
Source§impl<B, O> ObjectFormat for ObjectMutBody<B, O>
impl<B, O> ObjectFormat for ObjectMutBody<B, O>
fn format_json(&self) -> Value
Source§impl<'de, B, O> RawDecode<'de> for ObjectMutBody<B, O>
impl<'de, B, O> RawDecode<'de> for ObjectMutBody<B, O>
fn raw_decode(buf: &'de [u8]) -> BuckyResult<(Self, &'de [u8])>
fn raw_decode_with_option( buf: &'de [u8], _opt: &RawDecodeOption, ) -> BuckyResult<(Self, &'de [u8])>
Source§impl<'de, B, O> RawDecodeWithContext<'de, &NamedObjectBodyContext> for ObjectMutBody<B, O>
impl<'de, B, O> RawDecodeWithContext<'de, &NamedObjectBodyContext> for ObjectMutBody<B, O>
fn raw_decode_with_context( buf: &'de [u8], _ctx: &NamedObjectBodyContext, ) -> BuckyResult<(Self, &'de [u8])>
Source§impl<'de, B, O> RawEncode for ObjectMutBody<B, O>
impl<'de, B, O> RawEncode for ObjectMutBody<B, O>
fn raw_measure(&self, _purpose: &Option<RawEncodePurpose>) -> BuckyResult<usize>
fn raw_encode<'a>( &self, _buf: &'a mut [u8], _purpose: &Option<RawEncodePurpose>, ) -> BuckyResult<&'a mut [u8]>
fn raw_hash_encode(&self) -> BuckyResult<Vec<u8>>
fn raw_tail_encode<'a>( &self, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose>, ) -> BuckyResult<&'a [u8]>
fn raw_encode_to_buffer(&self) -> BuckyResult<Vec<u8>>
fn raw_hash_value(&self) -> BuckyResult<HashValue>
fn hash_buf(&self, encoded_buf: &[u8]) -> HashValue
Source§impl<'de, B, O> RawEncodeWithContext<NamedObjectBodyContext> for ObjectMutBody<B, O>
impl<'de, B, O> RawEncodeWithContext<NamedObjectBodyContext> for ObjectMutBody<B, O>
fn raw_measure_with_context( &self, ctx: &mut NamedObjectBodyContext, purpose: &Option<RawEncodePurpose>, ) -> BuckyResult<usize>
fn raw_encode_with_context<'a>( &self, buf: &'a mut [u8], ctx: &mut NamedObjectBodyContext, purpose: &Option<RawEncodePurpose>, ) -> BuckyResult<&'a mut [u8]>
fn raw_tail_encode_with_context<'a>( &self, buf: &'a mut [u8], context: &mut Context, purpose: &Option<RawEncodePurpose>, ) -> BuckyResult<&'a [u8]>
Auto Trait Implementations§
impl<B, O> Freeze for ObjectMutBody<B, O>where
B: Freeze,
impl<B, O> RefUnwindSafe for ObjectMutBody<B, O>where
B: RefUnwindSafe,
O: RefUnwindSafe,
impl<B, O> Send for ObjectMutBody<B, O>
impl<B, O> Sync for ObjectMutBody<B, O>
impl<B, O> Unpin for ObjectMutBody<B, O>
impl<B, O> UnwindSafe for ObjectMutBody<B, O>where
B: UnwindSafe,
O: 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§impl<'de, D> FileDecoder<'de> for Dwhere
D: RawDecode<'de>,
impl<'de, D> FileDecoder<'de> for Dwhere
D: RawDecode<'de>,
fn decode_from_file( file: &Path, buf: &'de mut Vec<u8>, ) -> Result<(D, usize), BuckyError>
Source§impl<D> FileEncoder<D> for Dwhere
D: RawEncode,
impl<D> FileEncoder<D> for Dwhere
D: RawEncode,
fn suggest_buffer_size(&self) -> Result<usize, BuckyError>
fn encode<'a>( &self, buf: &'a mut [u8], _is_compress: bool, ) -> Result<&'a mut [u8], BuckyError>
fn encode_to_writer( &self, writer: impl Write, is_compress: bool, ) -> BuckyResult<usize>
fn encode_to_file(&self, file: &Path, is_compress: bool) -> BuckyResult<usize>
fn encode_to_vec(&self, is_compress: bool) -> BuckyResult<Vec<u8>>
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