[−][src]Struct norad::Layer
A layer, corresponding to a 'glyphs' directory. Conceptually, a layer is just a collection of glyphs.
Fields
glyphs: BTreeMap<GlyphName, Arc<Glyph>>
Methods
impl Layer
[src]
pub fn load<P: AsRef<Path>>(path: P) -> Result<Layer, Error>
[src]
pub fn get_glyph<K: ?Sized>(&self, glyph: &K) -> Option<&Arc<Glyph>> where
GlyphName: Borrow<K>,
K: Ord,
[src]
GlyphName: Borrow<K>,
K: Ord,
Returns a reference the glyph with the given name, if it exists.
pub fn get_glyph_mut<K: ?Sized>(&mut self, glyph: &K) -> Option<&mut Arc<Glyph>> where
GlyphName: Borrow<K>,
K: Ord,
[src]
GlyphName: Borrow<K>,
K: Ord,
Returns a mutable reference to the glyph with the given name, if it exists.
pub fn contains_glyph(&self, name: &str) -> bool
[src]
Returns true
if this layer contains a glyph with this name.
pub fn set_glyph<P: Into<PathBuf>>(&mut self, path: P, glyph: Glyph)
[src]
Set the given glyph. The name is taken from the glyph's name
field.
This replaces any existing glyph with this name.
pub fn delete_glyph(&mut self, name: &str)
[src]
Remove the named glyph from this layer.
pub fn iter_contents<'a>(&'a self) -> impl Iterator<Item = Arc<Glyph>> + 'a
[src]
Iterate over the glyphs in this layer.
Trait Implementations
Auto Trait Implementations
impl Send for Layer
impl Sync for Layer
impl Unpin for Layer
impl UnwindSafe for Layer
impl RefUnwindSafe for Layer
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,