#[non_exhaustive]pub enum ContentEditableState {
True,
False,
PlaintextOnly,
}Expand description
A contenteditable attribute’s explicit state (HTML §6.8.1). The
inherit state is the absence of one (None).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
True
true or "": the element is an editing host.
False
false: the element is not editable, whatever its ancestors are.
PlaintextOnly
plaintext-only: an editing host whose edits are plain text.
Implementations§
Source§impl ContentEditableState
impl ContentEditableState
Sourcepub fn from_attribute(value: &str) -> Option<Self>
pub fn from_attribute(value: &str) -> Option<Self>
Parse an attribute value: the keyword, ASCII case-insensitively;
None (inherit) for anything else.
Sourcepub fn keyword(self) -> &'static str
pub fn keyword(self) -> &'static str
The canonical keyword — what the contentEditable IDL getter
returns for this state.
Sourcepub fn is_editing_host(self) -> bool
pub fn is_editing_host(self) -> bool
true for the two states that make an element an editing host.
Trait Implementations§
Source§impl Clone for ContentEditableState
impl Clone for ContentEditableState
impl Copy for ContentEditableState
Source§impl Debug for ContentEditableState
impl Debug for ContentEditableState
impl Eq for ContentEditableState
Source§impl PartialEq for ContentEditableState
impl PartialEq for ContentEditableState
impl StructuralPartialEq for ContentEditableState
Auto Trait Implementations§
impl Freeze for ContentEditableState
impl RefUnwindSafe for ContentEditableState
impl Send for ContentEditableState
impl Sync for ContentEditableState
impl Unpin for ContentEditableState
impl UnsafeUnpin for ContentEditableState
impl UnwindSafe for ContentEditableState
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