pub struct Segment<C>where
C: CodeqConfig,{
pub offset: u64,
pub size: u64,
/* private fields */
}Expand description
Represents a contiguous region in a file or buffer with an offset and size.
A segment is defined by:
- An offset: starting position in bytes
- A size: length in bytes
The generic parameter C specifies the checksum configuration to use for protecting the segment
data.
Fields§
§offset: u64Starting position of the segment in bytes
size: u64Length of the segment in bytes
Implementations§
Trait Implementations§
Source§impl<C> Decode for Segment<C>where
C: CodeqConfig,
impl<C> Decode for Segment<C>where
C: CodeqConfig,
Source§impl<'de, C> Deserialize<'de> for Segment<C>where
C: CodeqConfig,
impl<'de, C> Deserialize<'de> for Segment<C>where
C: CodeqConfig,
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<C> Encode for Segment<C>where
C: CodeqConfig,
impl<C> Encode for Segment<C>where
C: CodeqConfig,
Source§impl<C> FixedSize for Segment<C>where
C: CodeqConfig,
impl<C> FixedSize for Segment<C>where
C: CodeqConfig,
Source§fn encoded_size() -> usize
fn encoded_size() -> usize
Returns the fixed size of an encoded segment (24 bytes):
- 8 bytes for offset
- 8 bytes for size
- 8 bytes for checksum
Source§impl<C> Serialize for Segment<C>where
C: CodeqConfig,
impl<C> Serialize for Segment<C>where
C: CodeqConfig,
Source§impl<C> Span for Segment<C>where
C: CodeqConfig,
impl<C> Span for Segment<C>where
C: CodeqConfig,
impl<C> Copy for Segment<C>where
C: CodeqConfig + Copy,
impl<C> Eq for Segment<C>where
C: CodeqConfig + Eq,
impl<C> StructuralPartialEq for Segment<C>where
C: CodeqConfig,
Auto Trait Implementations§
impl<C> Freeze for Segment<C>
impl<C> RefUnwindSafe for Segment<C>where
C: RefUnwindSafe,
impl<C> Send for Segment<C>where
C: Send,
impl<C> Sync for Segment<C>where
C: Sync,
impl<C> Unpin for Segment<C>where
C: Unpin,
impl<C> UnwindSafe for Segment<C>where
C: 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