Struct devices::register_space::register::RegisterRange
source · pub struct RegisterRange {
pub from: u64,
pub to: u64,
}
Expand description
This represents a range of memory in the register space starting. Both from and to are inclusive.
Fields§
§from: u64
§to: u64
Implementations§
source§impl RegisterRange
impl RegisterRange
sourcepub fn overlap_with(&self, other: &RegisterRange) -> bool
pub fn overlap_with(&self, other: &RegisterRange) -> bool
Return true if those range overlaps.
sourcepub fn overlap_range(&self, other: &RegisterRange) -> Option<RegisterRange>
pub fn overlap_range(&self, other: &RegisterRange) -> Option<RegisterRange>
Get the overlapping part of two RegisterRange. Return is Option(overlap_from, overlap_to). For example, (4,7).overlap_range(5, 8) will be Some(5, 7).
Trait Implementations§
source§impl Clone for RegisterRange
impl Clone for RegisterRange
source§fn clone(&self) -> RegisterRange
fn clone(&self) -> RegisterRange
Returns a copy 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 Debug for RegisterRange
impl Debug for RegisterRange
source§impl Ord for RegisterRange
impl Ord for RegisterRange
source§fn cmp(&self, other: &RegisterRange) -> Ordering
fn cmp(&self, other: &RegisterRange) -> Ordering
1.21.0 · 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 RegisterRange
impl PartialEq for RegisterRange
source§fn eq(&self, other: &RegisterRange) -> bool
fn eq(&self, other: &RegisterRange) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for RegisterRange
impl PartialOrd for RegisterRange
source§fn partial_cmp(&self, other: &RegisterRange) -> Option<Ordering>
fn partial_cmp(&self, other: &RegisterRange) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for RegisterRange
impl Eq for RegisterRange
impl StructuralPartialEq for RegisterRange
Auto Trait Implementations§
impl RefUnwindSafe for RegisterRange
impl Send for RegisterRange
impl Sync for RegisterRange
impl Unpin for RegisterRange
impl UnwindSafe for RegisterRange
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.