pub enum LeafPolicy {
Builtin,
Types(HashSet<String>),
}Expand description
Decides which nodes are ProseMirror leaves (size 1) vs empty containers (size 2). Leafness isn’t recoverable from JSON, so it’s configured here.
Variants§
Builtin
Built-in Tiptap atoms: image, horizontalRule, hardBreak.
Types(HashSet<String>)
An explicit set of node-type names to treat as leaves.
Implementations§
Source§impl LeafPolicy
impl LeafPolicy
Sourcepub fn from_types<I, S>(types: I) -> Self
pub fn from_types<I, S>(types: I) -> Self
Build a policy from an explicit list of leaf type names.
Trait Implementations§
Source§impl Clone for LeafPolicy
impl Clone for LeafPolicy
Source§fn clone(&self) -> LeafPolicy
fn clone(&self) -> LeafPolicy
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 LeafPolicy
impl Debug for LeafPolicy
Source§impl Default for LeafPolicy
impl Default for LeafPolicy
Source§fn default() -> LeafPolicy
fn default() -> LeafPolicy
Returns the “default value” for a type. Read more
Source§impl PartialEq for LeafPolicy
impl PartialEq for LeafPolicy
Source§fn eq(&self, other: &LeafPolicy) -> bool
fn eq(&self, other: &LeafPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for LeafPolicy
impl StructuralPartialEq for LeafPolicy
Auto Trait Implementations§
impl Freeze for LeafPolicy
impl RefUnwindSafe for LeafPolicy
impl Send for LeafPolicy
impl Sync for LeafPolicy
impl Unpin for LeafPolicy
impl UnsafeUnpin for LeafPolicy
impl UnwindSafe for LeafPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.