Skip to main content

HtmlSummaryElement

Struct HtmlSummaryElement 

Source
pub struct HtmlSummaryElement(/* private fields */);
Expand description

<summary> — summary for a <details> element.

Trait Implementations§

Source§

impl Clone for HtmlSummaryElement

Source§

fn clone(&self) -> HtmlSummaryElement

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ContainerNode for HtmlSummaryElement

Source§

fn append(&self, child: impl HasHandle)

Append child as the last child of this node. Read more
Source§

fn child(self, child: impl HasHandle) -> Self

Append a child and return self for chaining (GPUI-style). Read more
Source§

fn add_children<I, C>(self, items: I) -> Self
where I: IntoIterator<Item = C>, C: HasHandle,

Append multiple children at once.
Source§

fn insert_before(&self, child: impl HasHandle)

Insert child before this node in the parent’s child list.
Source§

fn first_child(&self) -> Option<Handle>

Get the first child, or None if empty.
Source§

fn last_child(&self) -> Option<Handle>

Get the last child, or None if empty.
Source§

fn children(&self) -> Vec<Handle>

Collect all children as Handles.
Source§

impl Debug for HtmlSummaryElement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Element for HtmlSummaryElement

Source§

const TAG_NAME: &'static str = "summary"

The default tag name (e.g., "div", "button", "input"). Read more
Source§

const IS_FOCUSABLE: bool = false

Whether this element is focusable by default.
Source§

type Data = ()

Element-specific data type (e.g., ButtonData). Use () if none.
Source§

fn from_handle(handle: Handle) -> Self

Wrap a raw Handle into this element’s typed handle. Read more
Source§

fn tag_name(&self) -> &'static str

Get the tag name (runtime — reads from ElementData). Read more
Source§

fn id(&self) -> String

Get the id attribute.
Source§

fn set_id(&self, id: impl Into<String>)

Set the id attribute.
Source§

fn class_name(&self) -> String

Get the class attribute.
Source§

fn set_class_name(&self, class: impl Into<String>)

Set the class attribute.
Source§

fn class_add(&self, name: &str)

Add a CSS class. No-op if already present. Chrome: element.classList.add("name").
Source§

fn class_remove(&self, name: &str)

Remove a CSS class. No-op if absent. Chrome: element.classList.remove("name").
Source§

fn class_toggle(&self, name: &str) -> bool

Toggle a CSS class. Returns true if now present. Chrome: element.classList.toggle("name").
Source§

fn class_contains(&self, name: &str) -> bool

Check if an element has a CSS class. Chrome: element.classList.contains("name").
Source§

fn attribute(&self, name: &str) -> Option<String>

Returns the attribute value for name, or None if absent.
Source§

fn set_attribute(&self, name: &str, value: impl Into<String>)

Set an attribute.
Source§

fn remove_attribute(&self, name: &str) -> Option<String>

Remove an attribute. Returns the old value.
Source§

impl EventTarget for HtmlSummaryElement

Source§

fn on<E: Event>( &self, callback: impl FnMut(&E, &EventContext) + 'static, ) -> ListenerId

Add a typed event listener. Returns an ID for removal. Read more
Source§

fn on_with_options<E: Event>( &self, callback: impl FnMut(&E, &EventContext) + 'static, options: ListenerOptions, ) -> ListenerId

Add a listener with explicit options. Read more
Source§

fn on_capture<E: Event>( &self, callback: impl FnMut(&E, &EventContext) + 'static, ) -> ListenerId

Add a capture-phase listener. Read more
Source§

fn on_once<E: Event>( &self, callback: impl FnMut(&E, &EventContext) + 'static, ) -> ListenerId

Add a one-shot listener that auto-removes after first call.
Source§

fn off(&self, id: ListenerId)

Remove a listener by its ID.
Source§

fn dispatch_event(&self, event: &dyn Event) -> bool

Dispatch an event to this target. Read more
Source§

impl HasHandle for HtmlSummaryElement

Source§

fn handle(&self) -> Handle

Get the inner Handle for this node/target. Read more
Source§

impl HtmlElement for HtmlSummaryElement

Source§

fn hidden(&self) -> bool

The hidden attribute. Elements with hidden should not be rendered.
Source§

fn set_hidden(&self, hidden: bool)

Source§

fn title(&self) -> String

The title attribute (tooltip text).
Source§

fn set_title(&self, title: impl Into<String>)

Source§

fn lang(&self) -> String

The lang attribute (language code).
Source§

fn set_lang(&self, lang: impl Into<String>)

Source§

fn dir(&self) -> String

The dir attribute (text direction: “ltr”, “rtl”, “auto”).
Source§

fn set_dir(&self, dir: impl Into<String>)

Source§

fn tab_index(&self) -> i32

The tabindex attribute. Controls focus order. Returns the element’s default if not explicitly set.
Source§

fn set_tab_index(&self, index: i32)

Source§

fn draggable(&self) -> bool

The draggable attribute.
Source§

fn set_draggable(&self, draggable: bool)

Source§

fn spellcheck(&self) -> bool

The spellcheck attribute.
Source§

fn set_spellcheck(&self, spellcheck: bool)

Source§

fn collect_presentation_styles(&self)

Map presentation attributes to a PropertyDeclarationBlock. Read more
Source§

fn attribute_changed(&self, _name: &str, _old: Option<&str>, _new: Option<&str>)

Called when an attribute changes. Read more
Source§

fn click(&self)

Programmatically click this element.
Source§

fn focus(&self)

Focus this element.
Source§

fn blur(&self)

Blur (unfocus) this element.
Source§

impl Node for HtmlSummaryElement

Source§

fn is_alive(&self) -> bool

Check if this node is still alive in the document. Read more
Source§

fn parent(&self) -> Option<Handle>

Get the parent node, or None if this is the root or detached.
Source§

fn next_sibling(&self) -> Option<Handle>

Get the next sibling in the parent’s child list.
Source§

fn prev_sibling(&self) -> Option<Handle>

Get the previous sibling in the parent’s child list.
Source§

fn detach(&self)

Detach this node from its parent. The node stays alive but is no longer in the tree.
Source§

fn destroy(&self)

Destroy this node. Frees the slot — all handles to it become stale.
Source§

fn raw(&self) -> RawId

Get the raw ID for cross-thread communication. Read more
Source§

fn node_kind(&self) -> Option<NodeType>

Get the DOM node type (Element, Text, Document, etc.).
Source§

fn is_element(&self) -> bool

Is this an element node?
Source§

fn is_text(&self) -> bool

Is this a text node?
Source§

fn is_document(&self) -> bool

Is this the document root?
Source§

fn style(&self) -> StyleAccess

Per-property style access — like JavaScript’s element.style.
Source§

fn styled(self, f: impl FnOnce(&mut StyleAccess)) -> Self

Apply styles via closure and return self for chaining. Read more
Source§

impl Copy for HtmlSummaryElement

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,