pub struct Loc { /* private fields */ }
Expand description
This struct is used to indicate locations on an image.
Implementations
sourceimpl Loc
impl Loc
sourcepub fn from_index(idx: usize, dimension: Dim) -> Self
pub fn from_index(idx: usize, dimension: Dim) -> Self
Returns the location from a one-dimensional index given dimensions.
sourcepub fn as_index(&self, dimension: Dim) -> usize
pub fn as_index(&self, dimension: Dim) -> usize
Returns the one-dimensional index from a location given dimensions.
sourcepub fn inside_region(&self, region: Region) -> bool
pub fn inside_region(&self, region: Region) -> bool
Checks if a location falls inside of a region.
Note that this function is left-inclusive, but right-exclusive.
Trait Implementations
impl Copy for Loc
impl Eq for Loc
impl StructuralEq for Loc
impl StructuralPartialEq for Loc
Auto Trait Implementations
impl RefUnwindSafe for Loc
impl Send for Loc
impl Sync for Loc
impl Unpin for Loc
impl UnwindSafe for Loc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more