pub struct ExternalLink { /* private fields */ }Expand description
A link to another site. It always has rel="noopener noreferrer", so the other site learns
neither the page it came from nor gets a handle on this window, and screen readers hear that
it leaves the app.
let help = ExternalLink::new("https://example.com/help", Text::from("Help center")).new_tab();
let site = ExternalLink::new("https://example.org", Text::from("Website")).user_content();.user_content() adds nofollow ugc for addresses users typed, so search engines do not
credit them. .new_tab() opens it in a new tab and says so; it stays in the same tab unless
set. Only https and http addresses become links; anything else, such as javascript:,
is shown as plain text.
Implementations§
Trait Implementations§
Source§impl Component for ExternalLink
impl Component for ExternalLink
fn render(&self, out: &mut String, r: &Render<'_>)
fn grid(&self) -> Option<&dyn GridSource>
fn form(&self) -> Option<&dyn FormSource>
Source§fn reveal(&self, _field: &str) -> Option<Revealed>
fn reveal(&self, _field: &str) -> Option<Revealed>
The raw value of a masked field this component shows, for an audited reveal. The server
checks the unmask permission before sending it.
Source§fn import(&self) -> Option<&dyn ImportSource>
fn import(&self) -> Option<&dyn ImportSource>
CSV import, for components that import rows (see
crate::Import).Source§fn children(&self) -> &[Node]
fn children(&self) -> &[Node]
Nodes held by a container. Child
i of the node at path p has the path p.i.Source§fn eager_children(&self) -> &[Node]
fn eager_children(&self) -> &[Node]
Children rendered with the page. Others, such as closed lazy tabs, load when first shown.
Source§impl From<ExternalLink> for Node
impl From<ExternalLink> for Node
Source§fn from(c: ExternalLink) -> Self
fn from(c: ExternalLink) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ExternalLink
impl RefUnwindSafe for ExternalLink
impl Send for ExternalLink
impl Sync for ExternalLink
impl Unpin for ExternalLink
impl UnsafeUnpin for ExternalLink
impl UnwindSafe for ExternalLink
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