pub struct ContainerDimensions { /* private fields */ }Expand description
The size of the container to draw, checked against the two size gates.
A validated pair rather than two loose integers: the only way to obtain one
is ContainerDimensions::new, which refuses anything the loader would
refuse, so no code downstream has to re-check a width or a height. A larger
container carries more — capacity is a straight function of its pixel count —
but every size this type admits is one a receiver can load and one whose
texture feeds the hash gate the same octave the default does; see
[crate::generate::texture] for why enlarging is safe rather than merely
tolerated.
Implementations§
Source§impl ContainerDimensions
impl ContainerDimensions
Sourcepub fn new(width: u32, height: u32) -> Result<Self, GenerateError>
pub fn new(width: u32, height: u32) -> Result<Self, GenerateError>
A dimensions pair, if it clears both gates a loaded container is held to.
§Errors
Returns GenerateError::DimensionsOutOfRange when either side is below
MIN_CONTAINER_SIDE, or when the two multiply to more than
MAX_CONTAINER_PIXELS. The product is taken in u64 so that two
large sides cannot wrap into a small count and slip past the ceiling.
Trait Implementations§
Source§impl Clone for ContainerDimensions
impl Clone for ContainerDimensions
Source§fn clone(&self) -> ContainerDimensions
fn clone(&self) -> ContainerDimensions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ContainerDimensions
Source§impl Debug for ContainerDimensions
impl Debug for ContainerDimensions
Source§impl Default for ContainerDimensions
impl Default for ContainerDimensions
Source§fn default() -> Self
fn default() -> Self
The square container the size-less call produces; see
DEFAULT_CONTAINER_SIDE.
impl Eq for ContainerDimensions
Source§impl PartialEq for ContainerDimensions
impl PartialEq for ContainerDimensions
impl StructuralPartialEq for ContainerDimensions
Auto Trait Implementations§
impl Freeze for ContainerDimensions
impl RefUnwindSafe for ContainerDimensions
impl Send for ContainerDimensions
impl Sync for ContainerDimensions
impl Unpin for ContainerDimensions
impl UnsafeUnpin for ContainerDimensions
impl UnwindSafe for ContainerDimensions
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
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<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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().