pub enum Draggable {
True,
False,
}Expand description
The draggable attribute values.
§Purpose
Indicates whether an element can be dragged using the HTML5 drag-and-drop API, enabling rich drag-and-drop interactions in web applications.
§Usage Context
- Used with: All HTML elements (global attribute)
- Default: Links and images are draggable by default; other elements are not
- Common use: File upload interfaces, sortable lists, drag-and-drop games
§Valid Values
True: Element is draggableFalse: Element is not draggable (overrides default behavior)
§Example
use ironhtml_attributes::{AttributeValue, Draggable};
let draggable = Draggable::True;
assert_eq!(draggable.to_attr_value(), "true");<div draggable="true">Drag me!</div>
<img src="photo.jpg" draggable="false" alt="Cannot drag this image">§WHATWG Specification
Variants§
True
Element is draggable and can be used with the drag-and-drop API.
False
Element is not draggable, overriding any default draggable behavior.
Trait Implementations§
Source§impl AttributeValue for Draggable
impl AttributeValue for Draggable
Source§fn to_attr_value(&self) -> Cow<'static, str>
fn to_attr_value(&self) -> Cow<'static, str>
Convert to the attribute value string.
impl Copy for Draggable
impl Eq for Draggable
impl StructuralPartialEq for Draggable
Auto Trait Implementations§
impl Freeze for Draggable
impl RefUnwindSafe for Draggable
impl Send for Draggable
impl Sync for Draggable
impl Unpin for Draggable
impl UnwindSafe for Draggable
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