pub struct Atlas {
pub pages: Vec<AtlasPage>,
pub regions: Vec<AtlasRegion>,
}Expand description
Parsed contents of a .atlas file: a set of texture pages and the regions
that reference them.
Fields§
§pages: Vec<AtlasPage>Pages in file order.
regions: Vec<AtlasRegion>Regions of every page, in file order.
Implementations§
Source§impl Atlas
impl Atlas
Sourcepub fn parse(text: &str) -> Result<Self, AtlasError>
pub fn parse(text: &str) -> Result<Self, AtlasError>
Parses .atlas text.
§Errors
AtlasError when a numeric field has too few values, or a numeric
field or unrecognized region key has a value that isn’t an integer.
Unrecognized format: and filter: values become Unknown instead.
Sourcepub fn find_region(&self, name: &str) -> Option<&AtlasRegion>
pub fn find_region(&self, name: &str) -> Option<&AtlasRegion>
First region named name. A linear scan; build a map for repeated
lookups.
Trait Implementations§
impl StructuralPartialEq for Atlas
Auto Trait Implementations§
impl Freeze for Atlas
impl RefUnwindSafe for Atlas
impl Send for Atlas
impl Sync for Atlas
impl Unpin for Atlas
impl UnsafeUnpin for Atlas
impl UnwindSafe for Atlas
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