pub enum ContentEditable {
True,
False,
Inherit,
}Expand description
The contenteditable attribute values.
§Purpose
Controls whether an element’s content can be edited by the user, enabling rich text editing and in-place content modification in web applications.
§Usage Context
- Used with: All HTML elements (global attribute)
- Common use: Rich text editors, inline editing, CMS interfaces
§Valid Values
True: Element content is editable by the userFalse: Element content is not editableInherit: Inherits editability from parent element
§Example
use ironhtml_attributes::{AttributeValue, ContentEditable};
let editable = ContentEditable::True;
assert_eq!(editable.to_attr_value(), "true");<div contenteditable="true">Edit this text directly!</div>
<div contenteditable="false">This cannot be edited</div>
<span contenteditable="inherit">Inherits from parent</span>§WHATWG Specification
Variants§
True
Content is editable by the user. The element becomes a rich text editing host.
False
Content is explicitly not editable. This overrides any inherited editability.
Inherit
Inherits the contenteditable state from the parent element.
Trait Implementations§
Source§impl AttributeValue for ContentEditable
impl AttributeValue for ContentEditable
Source§fn to_attr_value(&self) -> Cow<'static, str>
fn to_attr_value(&self) -> Cow<'static, str>
Convert to the attribute value string.
Source§impl Clone for ContentEditable
impl Clone for ContentEditable
Source§fn clone(&self) -> ContentEditable
fn clone(&self) -> ContentEditable
Returns a duplicate of the value. Read more
1.0.0 · 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 ContentEditable
impl Debug for ContentEditable
Source§impl PartialEq for ContentEditable
impl PartialEq for ContentEditable
impl Copy for ContentEditable
impl Eq for ContentEditable
impl StructuralPartialEq for ContentEditable
Auto Trait Implementations§
impl Freeze for ContentEditable
impl RefUnwindSafe for ContentEditable
impl Send for ContentEditable
impl Sync for ContentEditable
impl Unpin for ContentEditable
impl UnwindSafe for ContentEditable
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