Struct moxie_dom::elements::text_semantics::ABuilder [−][src]
pub struct ABuilder { /* fields omitted */ }
Expand description
The HTML <a>
element (or anchor element), along with its href attribute, creates
a hyperlink to other web pages, files, locations within the same page, email addresses, or
any other URL.
A type for initializing the element’s attributes before calling build
.
Implementations
Prompts the user to save the linked URL instead of navigating to it. Can be used with or without a value:
- Without a value, the browser will suggest a filename/extension, generated from various
sources:
- The Content-Disposition HTTP header
- The final segment in the URL path
- The media type (from the (Content-Type header, the start of a data: URL, or Blob.type for a blob: URL)
- Defining a value suggests it as the filename.
/
and\
characters are converted to underscores (_). Filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if necessary.
Notes:
- download only works for same-origin URLs, or the blob: and data: schemes.
- If Content-Disposition has a different filename than download, the header takes priority. (If
Content-Disposition: inline
, Firefox prefers the header while Chrome prefers download.)
The URL that the hyperlink points to. Links are not restricted to HTTP-based URLs — they can use any URL scheme supported by browsers:
- Sections of a page with fragment URLs
- Pieces of media files with media fragments
- Telephone numbers with tel: URLs
- Email addresses with mailto: URLs
- While web browsers may not support other URL schemes, web sites can with registerProtocolHandler()
Hints at the human language of the linked URL. No built-in functionality. Allowed values are the same as the global lang attribute.
A space-separated list of URLs. When the link is followed, the browser will send POST requests with the body PING to the URLs. Typically for tracking.
The relationship of the linked URL as space-separated link types.
Where to display the linked URL, as the name for a browsing context (a tab, window, or
<iframe>
). The following keywords have special meanings for where to load the URL:
_self
: the current browsing context. (Default)_blank
: usually a new tab, but users can configure browsers to open a new window instead._parent
: the parent browsing context of the current one. If no parent, behaves as _self._top
: the topmost browsing context (the “highest” context that’s an ancestor of the current one). If no ancestors, behaves as _self.
Note: When using target, add rel=“noreferrer noopener” to avoid exploitation of the window.opener API;
Note: Linking to another page with target=“_blank” will run the new page in the same process as your page. If the new page executes JavaScript, your page’s performance may suffer. This can also be avoided by using rel=“noreferrer noopener”.
Trait Implementations
Declare an attribute of the element, mutating the actual element’s attribute when the passed value changes. Read more
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Set an event handler.
Keyboard shortcut to activate or add focus to the element.
Sets whether input is automatically capitalized when entered by user. It can have the following values: Read more
A value of “true” means the element is editable and a value of “false” means it isn’t.
The directionality of the element. It can have the following values: Read more
Indicates if the element is hidden or not.
Indicates whether the user agent must act as though the given node is absent for the purposes of user interaction events, in-page text searches (“find in page”), and text selection. Read more
Provides a hint as to the type of data that might be entered by the user while editing the element or its contents. The attribute can be used with form controls (such as the value of textarea elements), or in elements in an editing host (e.g., using contenteditable attribute). Read more
The language of an element’s attributes, text, and element contents.
Assigns a slot in a shadow DOM shadow tree to an element.
Indicates whether spell checking is allowed for the element.
Overrides the browser’s default tab order and follows the one specified instead. Read more
Retrieves access to the raw HTML element underlying the (CachedNode). Read more
Add a child to this node.
Auto Trait Implementations
impl !RefUnwindSafe for ABuilder
impl !UnwindSafe for ABuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more