pub struct PieceOffset(/* private fields */);Expand description
Piece offset in a sector
Implementations§
Trait Implementations§
Source§impl Add for PieceOffset
impl Add for PieceOffset
Source§impl AddAssign for PieceOffset
impl AddAssign for PieceOffset
Source§fn add_assign(&mut self, __rhs: Self)
fn add_assign(&mut self, __rhs: Self)
Performs the
+= operation. Read moreimpl AnyBitPatternMarker for PieceOffsetwhere
for<'__ab_io_type> u16: AnyBitPatternMarker,
Source§impl Clone for PieceOffset
impl Clone for PieceOffset
Source§fn clone(&self) -> PieceOffset
fn clone(&self) -> PieceOffset
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PieceOffset
Source§impl Debug for PieceOffset
impl Debug for PieceOffset
Source§impl Decode for PieceOffset
impl Decode for PieceOffset
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Attempt to deserialise the value from input.
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
Source§impl Default for PieceOffset
impl Default for PieceOffset
Source§fn default() -> PieceOffset
fn default() -> PieceOffset
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PieceOffset
impl<'de> Deserialize<'de> for PieceOffset
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PieceOffset
impl Display for PieceOffset
Source§impl<__derive_more_Rhs> Div<__derive_more_Rhs> for PieceOffset
impl<__derive_more_Rhs> Div<__derive_more_Rhs> for PieceOffset
Source§impl<__derive_more_Rhs> DivAssign<__derive_more_Rhs> for PieceOffset
impl<__derive_more_Rhs> DivAssign<__derive_more_Rhs> for PieceOffset
Source§fn div_assign(&mut self, __rhs: __derive_more_Rhs)
fn div_assign(&mut self, __rhs: __derive_more_Rhs)
Performs the
/= operation. Read moreSource§impl Encode for PieceOffset
impl Encode for PieceOffset
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
impl EncodeLike for PieceOffset
impl Eq for PieceOffset
Source§impl From<PieceOffset> for u16
impl From<PieceOffset> for u16
Source§fn from(value: PieceOffset) -> Self
fn from(value: PieceOffset) -> Self
Converts to this type from the input type.
Source§impl From<PieceOffset> for u32
impl From<PieceOffset> for u32
Source§fn from(original: PieceOffset) -> Self
fn from(original: PieceOffset) -> Self
Converts to this type from the input type.
Source§impl From<PieceOffset> for u64
impl From<PieceOffset> for u64
Source§fn from(original: PieceOffset) -> Self
fn from(original: PieceOffset) -> Self
Converts to this type from the input type.
Source§impl From<PieceOffset> for usize
impl From<PieceOffset> for usize
Source§fn from(original: PieceOffset) -> Self
fn from(original: PieceOffset) -> Self
Converts to this type from the input type.
Source§impl From<u16> for PieceOffset
impl From<u16> for PieceOffset
Source§impl Hash for PieceOffset
impl Hash for PieceOffset
Source§impl MaxEncodedLen for PieceOffset
impl MaxEncodedLen for PieceOffset
Source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
Source§impl<__derive_more_Rhs> Mul<__derive_more_Rhs> for PieceOffset
impl<__derive_more_Rhs> Mul<__derive_more_Rhs> for PieceOffset
Source§impl<__derive_more_Rhs> MulAssign<__derive_more_Rhs> for PieceOffset
impl<__derive_more_Rhs> MulAssign<__derive_more_Rhs> for PieceOffset
Source§fn mul_assign(&mut self, __rhs: __derive_more_Rhs)
fn mul_assign(&mut self, __rhs: __derive_more_Rhs)
Performs the
*= operation. Read moreSource§impl Ord for PieceOffset
impl Ord for PieceOffset
Source§fn cmp(&self, other: &PieceOffset) -> Ordering
fn cmp(&self, other: &PieceOffset) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PieceOffset
impl PartialEq for PieceOffset
Source§impl PartialOrd for PieceOffset
impl PartialOrd for PieceOffset
Source§impl Serialize for PieceOffset
impl Serialize for PieceOffset
Source§impl Step for PieceOffset
impl Step for PieceOffset
Source§fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>)
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>)
🔬This is a nightly-only experimental API. (
step_trait)Returns the bounds on the number of successor steps required to get from
start to end
like Iterator::size_hint(). Read moreSource§fn forward_checked(start: Self, count: usize) -> Option<Self>
fn forward_checked(start: Self, count: usize) -> Option<Self>
🔬This is a nightly-only experimental API. (
step_trait)Source§fn forward_overflowing(start: Self, count: usize) -> (Self, bool)
fn forward_overflowing(start: Self, count: usize) -> (Self, bool)
🔬This is a nightly-only experimental API. (
step_trait)Returns the value that would be obtained by taking the successor
of
self count times along with a boolean tracking whether overflow
occurred. Read moreSource§fn backward_checked(start: Self, count: usize) -> Option<Self>
fn backward_checked(start: Self, count: usize) -> Option<Self>
🔬This is a nightly-only experimental API. (
step_trait)Source§fn backward_overflowing(start: Self, count: usize) -> (Self, bool)
fn backward_overflowing(start: Self, count: usize) -> (Self, bool)
🔬This is a nightly-only experimental API. (
step_trait)Returns the value that would be obtained by taking the successor
of
self count times along with a boolean tracking whether overflow
occurred. Read moreSource§fn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§unsafe fn forward_unchecked(start: Self, count: usize) -> Self
unsafe fn forward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§unsafe fn backward_unchecked(start: Self, count: usize) -> Self
unsafe fn backward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)impl StructuralPartialEq for PieceOffset
Source§impl Sub for PieceOffset
impl Sub for PieceOffset
Source§impl SubAssign for PieceOffset
impl SubAssign for PieceOffset
Source§fn sub_assign(&mut self, __rhs: Self)
fn sub_assign(&mut self, __rhs: Self)
Performs the
-= operation. Read moreSource§impl TrivialType for PieceOffsetwhere
u16: TrivialType,
impl TrivialType for PieceOffsetwhere
u16: TrivialType,
Source§const METADATA: &[u8]
const METADATA: &[u8]
Data structure metadata in binary form, describing shape and types of the contents, see
IoTypeMetadataKind for encoding details.Source§fn try_from_bytes_unaligned(bytes: &[u8]) -> Option<(&Unaligned<Self>, &[u8])>
fn try_from_bytes_unaligned(bytes: &[u8]) -> Option<(&Unaligned<Self>, &[u8])>
Parse the beginning of
bytes, which don’t need to be aligned. Read moreconst SIZE: u32 = _
Source§final fn try_from_bytes(bytes: &[u8]) -> Option<(&Self, &[u8])>
final fn try_from_bytes(bytes: &[u8]) -> Option<(&Self, &[u8])>
Parse the beginning of aligned
bytes, returns the value and the remaining bytes. Read moreSource§final fn try_from_bytes_exact(bytes: &[u8]) -> Option<&Self>
final fn try_from_bytes_exact(bytes: &[u8]) -> Option<&Self>
Like
Self::try_from_bytes(), but returns None if there are more bytes than the valueSource§final fn try_from_bytes_mut(bytes: &mut [u8]) -> Option<(&mut Self, &mut [u8])>
final fn try_from_bytes_mut(bytes: &mut [u8]) -> Option<(&mut Self, &mut [u8])>
Like
Self::try_from_bytes(), but returns an exclusive reference. Read moreSource§final fn try_read_unaligned(bytes: &[u8]) -> Option<(Self, &[u8])>
final fn try_read_unaligned(bytes: &[u8]) -> Option<(Self, &[u8])>
Read a copy from the beginning of
bytes, which don’t need to be aligned, returns the value
and the remaining bytesSource§final fn try_read_unaligned_exact(bytes: &[u8]) -> Option<Self>
final fn try_read_unaligned_exact(bytes: &[u8]) -> Option<Self>
Like
Self::try_read_unaligned(), but returns None if there are more bytes than the
valueSource§final unsafe fn read_unaligned(bytes: &[u8]) -> Option<Self>
final unsafe fn read_unaligned(bytes: &[u8]) -> Option<Self>
Read unaligned value from memory. Read more
Source§final unsafe fn read_unaligned_unchecked(bytes: &[u8]) -> Self
final unsafe fn read_unaligned_unchecked(bytes: &[u8]) -> Self
Similar to
Self::read_unaligned(), but doesn’t do any checks at all. Read moreSource§final unsafe fn from_bytes(bytes: &[u8]) -> Option<&Self>
final unsafe fn from_bytes(bytes: &[u8]) -> Option<&Self>
Create a reference to a type, which is represented by provided memory. Read more
Source§final unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &Self
final unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &Self
Similar to
Self::from_bytes(), but doesn’t do any checks at all. Read moreSource§final unsafe fn from_bytes_mut(bytes: &mut [u8]) -> Option<&mut Self>
final unsafe fn from_bytes_mut(bytes: &mut [u8]) -> Option<&mut Self>
Create a mutable reference to a type, which is represented by provided memory. Read more
Source§final unsafe fn from_bytes_mut_unchecked(bytes: &mut [u8]) -> &mut Self
final unsafe fn from_bytes_mut_unchecked(bytes: &mut [u8]) -> &mut Self
Similar to
Self::from_bytes_mut(), but doesn’t do any checks at all. Read moreSource§final fn as_bytes(&self) -> &[u8; ab_io_type::trivial_type::SIZE_OF::<Self>]
final fn as_bytes(&self) -> &[u8; ab_io_type::trivial_type::SIZE_OF::<Self>]
Access the underlying byte representation of a data structure
Source§final unsafe fn as_bytes_mut(
&mut self,
) -> &mut [u8; ab_io_type::trivial_type::SIZE_OF::<Self>]
final unsafe fn as_bytes_mut( &mut self, ) -> &mut [u8; ab_io_type::trivial_type::SIZE_OF::<Self>]
Access the underlying mutable byte representation of a data structure. Read more
Auto Trait Implementations§
impl Freeze for PieceOffset
impl RefUnwindSafe for PieceOffset
impl Send for PieceOffset
impl Sync for PieceOffset
impl Unpin for PieceOffset
impl UnsafeUnpin for PieceOffset
impl UnwindSafe for PieceOffset
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: TrivialType + AnyBitPatternMarker,
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,
impl<S> Codec for Swhere
S: Decode + Encode,
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Decode
Self and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> EncodeLike<&&T> for Twhere
T: Encode,
impl<T> EncodeLike<&T> for Twhere
T: Encode,
impl<T> EncodeLike<&mut T> for Twhere
T: Encode,
impl<T> EncodeLike<Arc<T>> for Twhere
T: Encode,
impl<T> EncodeLike<Box<T>> for Twhere
T: Encode,
impl<T> EncodeLike<Cow<'_, T>> for Twhere
T: ToOwned + Encode,
impl<T> EncodeLike<Rc<T>> for Twhere
T: Encode,
impl<S> FullCodec for Swhere
S: Decode + FullEncode,
impl<S> FullEncode for Swhere
S: Encode + EncodeLike,
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 moreSource§impl<T> IoType for Twhere
T: TrivialType,
impl<T> IoType for Twhere
T: TrivialType,
Source§const METADATA: &'static [u8] = T::METADATA
const METADATA: &'static [u8] = T::METADATA
Data structure metadata in binary form, describing shape and types of the contents, see
IoTypeMetadataKind for encoding detailsSource§type PointerType = T
type PointerType = T
Pointer with a trivial type that this
IoType representsSource§type WithLifetime<'b> = T
type WithLifetime<'b> = T
The same type, viewing memory borrowed for
'b. Read moreSource§type Reborrowed<'b> = &'b mut T
type Reborrowed<'b> = &'b mut T
Source§unsafe fn from_ptr<'a>(
ptr: &'a NonNull<<T as IoType>::PointerType>,
size: &'a u32,
capacity: u32,
) -> impl Deref<Target = <T as IoType>::WithLifetime<'a>> + 'a
unsafe fn from_ptr<'a>( ptr: &'a NonNull<<T as IoType>::PointerType>, size: &'a u32, capacity: u32, ) -> impl Deref<Target = <T as IoType>::WithLifetime<'a>> + 'a
Create a reference to a type, which is represented by provided memory. Read more
Source§unsafe fn from_mut_ptr<'a>(
ptr: &'a mut NonNull<<T as IoType>::PointerType>,
_size: &'a mut u32,
capacity: u32,
) -> impl DerefMut + 'a
unsafe fn from_mut_ptr<'a>( ptr: &'a mut NonNull<<T as IoType>::PointerType>, _size: &'a mut u32, capacity: u32, ) -> impl DerefMut + 'a
Create a mutable reference to a type, which is represented by provided memory. Read more
Source§unsafe fn try_from_ptr<'a>(
ptr: &'a NonNull<<T as IoType>::PointerType>,
size: &'a u32,
capacity: u32,
) -> Option<impl Deref<Target = <T as IoType>::WithLifetime<'a>> + 'a>
unsafe fn try_from_ptr<'a>( ptr: &'a NonNull<<T as IoType>::PointerType>, size: &'a u32, capacity: u32, ) -> Option<impl Deref<Target = <T as IoType>::WithLifetime<'a>> + 'a>
Create a reference to a type, which is represented by provided memory, if the memory holds a
valid value. Read more
Source§unsafe fn try_from_mut_ptr<'a>(
ptr: &'a mut NonNull<<T as IoType>::PointerType>,
size: &'a mut u32,
capacity: u32,
) -> Option<impl DerefMut + 'a>
unsafe fn try_from_mut_ptr<'a>( ptr: &'a mut NonNull<<T as IoType>::PointerType>, size: &'a mut u32, capacity: u32, ) -> Option<impl DerefMut + 'a>
Like
Self::try_from_ptr(), but returns an exclusive reference. Read moreSource§fn as_ptr(&self) -> NonNull<<T as IoType>::PointerType>
fn as_ptr(&self) -> NonNull<<T as IoType>::PointerType>
Get a raw pointer to the underlying data. Read more
Source§fn as_mut_ptr(&mut self) -> NonNull<<T as IoType>::PointerType>
fn as_mut_ptr(&mut self) -> NonNull<<T as IoType>::PointerType>
Get an exclusive raw pointer to the underlying data. Read more
Source§fn reborrow_mut(&mut self) -> <T as IoType>::Reborrowed<'_>
fn reborrow_mut(&mut self) -> <T as IoType>::Reborrowed<'_>
Exclusive access to this value for the duration of the borrow. Read more