pub struct ZoomSet(/* private fields */);Expand description
ZoomSet is a set of zoom levels represented as a 32-bit unsigned integer
where each bit represents a zoom level (0 <= z <= 30). BY DEFAULT: The
least significant bit represents zoom level 0 and the SECOND most significant
bit represents zoom level 30. BUT if the MOST significant bit is 1, then the
order is reversed.
§Examples
use utiles_core::zoom::ZoomSet;
let zset_int_fwd = ZoomSet::new(0b0000_0000_0000_0000_0000_0000_0000_0111);
// ^ is 1 so the order is forward/default
let zset_int_rev = ZoomSet::new(0b1111_0000_0000_0000_0000_0000_0000_0000);
// ^ is 1 so the order is reversed
let zooms_fwd_vec: Vec<u8> = zset_int_fwd.into();
assert_eq!(zooms_fwd_vec, vec![0, 1, 2]);
let zooms_rev_vec: Vec<u8> = zset_int_rev.into();
assert_eq!(zooms_rev_vec, vec![0, 1, 2]);Implementations§
Trait Implementations§
Source§impl From<ZoomRange> for ZoomSet
Convert range of zoom levels to a set of zoom levels
impl From<ZoomRange> for ZoomSet
Convert range of zoom levels to a set of zoom levels
§Examples
use utiles_core::zoom::{ZoomRange, ZoomSet};
let zrange = ZoomRange::new(0, 7);
let zset: ZoomSet = zrange.into();
assert_eq!(zset, ZoomSet::new(0b0000_0000_0000_0000_0000_0000_1111_1111));impl Copy for ZoomSet
impl Eq for ZoomSet
impl StructuralPartialEq for ZoomSet
Auto Trait Implementations§
impl Freeze for ZoomSet
impl RefUnwindSafe for ZoomSet
impl Send for ZoomSet
impl Sync for ZoomSet
impl Unpin for ZoomSet
impl UnwindSafe for ZoomSet
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
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§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.