pub struct PyramidSession { /* private fields */ }Expand description
One canvas’s pyramid in progress.
Implementations§
Source§impl PyramidSession
impl PyramidSession
Sourcepub fn new(
canvas: &str,
width: f64,
height: f64,
size: usize,
) -> Result<Self, PyramidError>
pub fn new( canvas: &str, width: f64, height: f64, size: usize, ) -> Result<Self, PyramidError>
A pyramid for canvas canvas whose bounds are width × height, over size-pixel tiles.
Sourcepub fn queue(&mut self, x: i32, y: i32) -> Result<(i32, i32), PyramidError>
pub fn queue(&mut self, x: i32, y: i32) -> Result<(i32, i32), PyramidError>
One stored index row (x, y) of the level below: queues its parent and returns the parent’s coordinates
(the host records the queued parent under them).
Sourcepub fn provide(
&mut self,
children: [Option<Vec<u8>>; 4],
) -> Result<(), PyramidError>
pub fn provide( &mut self, children: [Option<Vec<u8>>; 4], ) -> Result<(), PyramidError>
The decoded pixels of the four children Step::NeedChildren asked for, None for each one not stored.
pub fn step(&mut self) -> Step
Auto Trait Implementations§
impl Freeze for PyramidSession
impl RefUnwindSafe for PyramidSession
impl Send for PyramidSession
impl Sync for PyramidSession
impl Unpin for PyramidSession
impl UnsafeUnpin for PyramidSession
impl UnwindSafe for PyramidSession
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> 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