pub enum Wrap {
Hard,
Soft,
Off,
}Expand description
The wrap attribute values for <textarea> elements.
§Purpose
Controls how text wrapping is handled when submitting textarea content, determining whether hard line breaks are inserted at wrap points.
§Usage Context
- Used with:
<textarea>elements only - Default:
softif not specified - Form submission: Affects submitted text formatting
§Valid Values
Hard: Insert newlines at wrap points when submittingSoft: No newlines inserted (visual wrapping only)Off: Disable wrapping entirely
§Example
use ironhtml_attributes::{AttributeValue, Wrap};
let wrap = Wrap::Hard;
assert_eq!(wrap.to_attr_value(), "hard");<textarea wrap="soft" cols="40">Visual wrapping only</textarea>
<textarea wrap="hard" cols="40">Newlines inserted at wrap</textarea>
<textarea wrap="off">No wrapping</textarea>§WHATWG Specification
Variants§
Hard
Hard wrapping. Browser inserts newline characters (CR+LF) at line
wrap points when submitting the form. Requires cols attribute.
Soft
Soft wrapping (default). Text wraps visually but no newlines are inserted in the submitted value.
Off
No wrapping. Text does not wrap; horizontal scrolling may occur.
Trait Implementations§
Source§impl AttributeValue for Wrap
impl AttributeValue for Wrap
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 Wrap
impl Eq for Wrap
impl StructuralPartialEq for Wrap
Auto Trait Implementations§
impl Freeze for Wrap
impl RefUnwindSafe for Wrap
impl Send for Wrap
impl Sync for Wrap
impl Unpin for Wrap
impl UnwindSafe for Wrap
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