pub struct StyleTable { /* private fields */ }Expand description
Interned styles. Index 0 is the default (Normal) style.
Implementations§
Source§impl StyleTable
impl StyleTable
Sourcepub fn with_default(normal: Style) -> Self
pub fn with_default(normal: Style) -> Self
A table whose default (Normal) style is normal, such as a file’s own Normal font.
pub fn get(&self, id: StyleId) -> &Style
pub fn intern(&mut self, s: Style) -> StyleId
Sourcepub fn derive(&mut self, id: StyleId, f: impl FnOnce(&mut Style)) -> StyleId
pub fn derive(&mut self, id: StyleId, f: impl FnOnce(&mut Style)) -> StyleId
The style id changed by f, interned.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = (StyleId, &Style)>
pub fn rebuild_index(&mut self)
Trait Implementations§
Source§impl Clone for StyleTable
impl Clone for StyleTable
Source§fn clone(&self) -> StyleTable
fn clone(&self) -> StyleTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StyleTable
impl Debug for StyleTable
Source§impl Default for StyleTable
impl Default for StyleTable
Source§impl<'de> Deserialize<'de> for StyleTable
impl<'de> Deserialize<'de> for StyleTable
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StyleTable
impl PartialEq for StyleTable
Source§impl Serialize for StyleTable
impl Serialize for StyleTable
impl StructuralPartialEq for StyleTable
Auto Trait Implementations§
impl Freeze for StyleTable
impl RefUnwindSafe for StyleTable
impl Send for StyleTable
impl Sync for StyleTable
impl Unpin for StyleTable
impl UnsafeUnpin for StyleTable
impl UnwindSafe for StyleTable
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