pub struct BufferRegion {
pub offset: u64,
pub size: u64,
}Expand description
Describes a region within a buffer.
Fields§
§offset: u64Byte offset from buffer start.
size: u64Size of the region in bytes.
Implementations§
Source§impl BufferRegion
impl BufferRegion
Sourcepub fn from_start(size: u64) -> Self
pub fn from_start(size: u64) -> Self
Create a region starting at offset 0.
Sourcepub fn overlaps(&self, other: &BufferRegion) -> bool
pub fn overlaps(&self, other: &BufferRegion) -> bool
Check if this region overlaps with another.
Sourcepub fn contained_in(&self, other: &BufferRegion) -> bool
pub fn contained_in(&self, other: &BufferRegion) -> bool
Check if this region is entirely contained within another.
Sourcepub fn intersection(&self, other: &BufferRegion) -> Option<BufferRegion>
pub fn intersection(&self, other: &BufferRegion) -> Option<BufferRegion>
Compute the intersection of two regions, if any.
Trait Implementations§
Source§impl Clone for BufferRegion
impl Clone for BufferRegion
Source§fn clone(&self) -> BufferRegion
fn clone(&self) -> BufferRegion
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 BufferRegion
Source§impl Debug for BufferRegion
impl Debug for BufferRegion
impl Eq for BufferRegion
Source§impl Hash for BufferRegion
impl Hash for BufferRegion
Source§impl PartialEq for BufferRegion
impl PartialEq for BufferRegion
Source§fn eq(&self, other: &BufferRegion) -> bool
fn eq(&self, other: &BufferRegion) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BufferRegion
Auto Trait Implementations§
impl Freeze for BufferRegion
impl RefUnwindSafe for BufferRegion
impl Send for BufferRegion
impl Sync for BufferRegion
impl Unpin for BufferRegion
impl UnsafeUnpin for BufferRegion
impl UnwindSafe for BufferRegion
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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