[][src]Struct norad::Layer

pub struct Layer {
    pub glyphs: BTreeMap<GlyphName, Arc<Glyph>>,
}

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]

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]

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

impl Default for Layer[src]

impl Debug for Layer[src]

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]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]