pub enum SwapOption {
InnerHtml,
OuterHtml,
BeforeBegin,
AfterBegin,
BeforeEnd,
AfterEnd,
Delete,
None,
}Expand description
How htmx swaps a response into the DOM.
Mirrors the values accepted by the hx-swap attribute. Used by
HxReswap and as the swap field of an
HxLocation.
Variants§
InnerHtml
Replace the inner HTML of the target element.
OuterHtml
Replace the entire target element.
BeforeBegin
Insert the response before the target element.
AfterBegin
Insert the response before the first child of the target element.
BeforeEnd
Insert the response after the last child of the target element.
AfterEnd
Insert the response after the target element.
Delete
Delete the target element regardless of the response.
None
Do not append the response to the target element.
Implementations§
Trait Implementations§
Source§impl Clone for SwapOption
impl Clone for SwapOption
Source§fn clone(&self) -> SwapOption
fn clone(&self) -> SwapOption
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 moreimpl Copy for SwapOption
Source§impl Debug for SwapOption
impl Debug for SwapOption
impl Eq for SwapOption
Source§impl From<SwapOption> for HxReswap
impl From<SwapOption> for HxReswap
Source§fn from(option: SwapOption) -> Self
fn from(option: SwapOption) -> Self
Converts to this type from the input type.
Source§impl From<SwapOption> for HeaderValue
impl From<SwapOption> for HeaderValue
Source§fn from(option: SwapOption) -> Self
fn from(option: SwapOption) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SwapOption
impl PartialEq for SwapOption
Source§impl Serialize for SwapOption
impl Serialize for SwapOption
impl StructuralPartialEq for SwapOption
Auto Trait Implementations§
impl Freeze for SwapOption
impl RefUnwindSafe for SwapOption
impl Send for SwapOption
impl Sync for SwapOption
impl Unpin for SwapOption
impl UnsafeUnpin for SwapOption
impl UnwindSafe for SwapOption
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
impl<T> CloneAny for T
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.