Struct html::inline_text::Code

source ·
#[non_exhaustive]
pub struct Code { /* private fields */ }
Expand description

The HTML <code> element

MDN Documentation

Implementations§

source§

impl Code

source

pub fn builder() -> CodeBuilder

Create a new builder

source§

impl Code

source

pub fn data_map(&self) -> &DataMap

Access the element’s data-* properties

source

pub fn data_map_mut(&mut self) -> &mut DataMap

Mutably access the element’s data-* properties

source§

impl Code

source

pub fn access_key(&self) -> Option<&str>

Get the value of the accesskey attribute

source

pub fn set_access_key(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the accesskey attribute

source

pub fn auto_capitalize(&self) -> Option<&str>

Get the value of the autocapitalize attribute

source

pub fn set_auto_capitalize( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the autocapitalize attribute

source

pub fn autofocus(&self) -> bool

Get the value of the autofocus attribute

source

pub fn set_autofocus(&mut self, value: bool)

Set the value of the autofocus attribute

source

pub fn class(&self) -> Option<&str>

Get the value of the class attribute

source

pub fn set_class(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the class attribute

source

pub fn content_editable(&self) -> Option<&str>

Get the value of the contenteditable attribute

source

pub fn set_content_editable( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the contenteditable attribute

source

pub fn direction(&self) -> Option<&str>

Get the value of the dir attribute

source

pub fn set_direction(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the dir attribute

source

pub fn draggable(&self) -> bool

Get the value of the draggable attribute

source

pub fn set_draggable(&mut self, value: bool)

Set the value of the draggable attribute

source

pub fn enter_key_hint(&self) -> Option<&str>

Get the value of the enterkeyhint attribute

source

pub fn set_enter_key_hint( &mut self, value: Option<impl Into<Cow<'static, str>>> )

Set the value of the enterkeyhint attribute

source

pub fn export_parts(&self) -> Option<&str>

Get the value of the exportparts attribute

source

pub fn set_export_parts(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the exportparts attribute

source

pub fn hidden(&self) -> Option<&str>

Get the value of the hidden attribute

source

pub fn set_hidden(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the hidden attribute

source

pub fn id(&self) -> Option<&str>

Get the value of the id attribute

source

pub fn set_id(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the id attribute

source

pub fn inert(&self) -> bool

Get the value of the inert attribute

source

pub fn set_inert(&mut self, value: bool)

Set the value of the inert attribute

source

pub fn input_mode(&self) -> Option<&str>

Get the value of the inputmode attribute

source

pub fn set_input_mode(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the inputmode attribute

source

pub fn is_(&self) -> Option<&str>

Get the value of the is attribute

source

pub fn set_is_(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the is attribute

source

pub fn item_id(&self) -> Option<&str>

Get the value of the itemid attribute

source

pub fn set_item_id(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the itemid attribute

source

pub fn item_prop(&self) -> Option<&str>

Get the value of the itemprop attribute

source

pub fn set_item_prop(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the itemprop attribute

source

pub fn item_ref(&self) -> Option<&str>

Get the value of the itemref attribute

source

pub fn set_item_ref(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the itemref attribute

source

pub fn item_scope(&self) -> Option<&str>

Get the value of the itemscope attribute

source

pub fn set_item_scope(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the itemscope attribute

source

pub fn item_type(&self) -> Option<&str>

Get the value of the itemtype attribute

source

pub fn set_item_type(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the itemtype attribute

source

pub fn lang(&self) -> Option<&str>

Get the value of the lang attribute

source

pub fn set_lang(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the lang attribute

source

pub fn nonce(&self) -> Option<&str>

Get the value of the nonce attribute

source

pub fn set_nonce(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the nonce attribute

source

pub fn part(&self) -> Option<&str>

Get the value of the part attribute

source

pub fn set_part(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the part attribute

source

pub fn slot(&self) -> Option<&str>

Get the value of the slot attribute

source

pub fn set_slot(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the slot attribute

source

pub fn spellcheck(&self) -> Option<&str>

Get the value of the spellcheck attribute

source

pub fn set_spellcheck(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the spellcheck attribute

source

pub fn style(&self) -> Option<&str>

Get the value of the style attribute

source

pub fn set_style(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the style attribute

source

pub fn tab_index(&self) -> Option<i64>

Get the value of the tabindex attribute

source

pub fn set_tab_index(&mut self, value: Option<i64>)

Set the value of the tabindex attribute

source

pub fn title(&self) -> Option<&str>

Get the value of the title attribute

source

pub fn set_title(&mut self, value: Option<impl Into<Cow<'static, str>>>)

Set the value of the title attribute

source

pub fn translate(&self) -> bool

Get the value of the translate attribute

source

pub fn set_translate(&mut self, value: bool)

Set the value of the translate attribute

source§

impl Code

source

pub fn children(&self) -> &[CodeChild]

Access the element’s children

source

pub fn children_mut(&mut self) -> &mut Vec<CodeChild>

Mutably access the element’s children

Trait Implementations§

source§

impl Clone for Code

source§

fn clone(&self) -> Code

Returns a copy 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 Debug for Code

source§

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

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

impl Default for Code

source§

fn default() -> Code

Returns the “default value” for a type. Read more
source§

impl Display for Code

source§

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

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

impl From<Code> for AbbreviationChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for AddressChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for AnchorChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for ArticleChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for AsideChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for AudioChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for BidirectionalIsolateChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for BidirectionalTextOverrideChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for BlockQuoteChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for BodyChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for BoldChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for ButtonChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for CanvasChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for CaptionChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for CiteChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for Code

source§

fn from(sys: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for CodeChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for DataChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for DataListChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for DefinitionChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for DeletedTextChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for DescriptionDetailsChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for DescriptionTermChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for DetailsChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for DialogChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for DivisionChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for EmphasisChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for FieldsetChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for FigureCaptionChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for FigureChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for FooterChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for FormChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for HeaderChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for Heading1Child

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for Heading2Child

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for Heading3Child

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for Heading4Child

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for Heading5Child

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for Heading6Child

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for ImageMapChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for InsertedTextChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for ItalicChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for KeyboardInputChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for LabelChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for LegendChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for ListItemChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for MainChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for MarkTextChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for MeterChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for NavigationChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for NoScriptChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for ObjectChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for OutputChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for ParagraphChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for PreformattedTextChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for ProgressChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for QuotationChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for RubyTextChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for SampleOutputChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for SearchChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for SectionChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for SideCommentChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for SlotChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for SpanChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for StrikeThroughChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for StrongChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for SubScriptChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for SummaryChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for SuperScriptChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for TableCellChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for TableHeaderChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for TimeChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for UnderlineChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for VariableChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl From<Code> for VideoChild

source§

fn from(value: Code) -> Self

Converts to this type from the input type.
source§

impl Into<Code> for Code

source§

fn into(self) -> Code

Converts this type into the (usually inferred) input type.
source§

impl PartialEq<Code> for Code

source§

fn eq(&self, other: &Code) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Render for Code

source§

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

Render an element with a given depth argument.
source§

impl FlowContent for Code

source§

impl HtmlElement for Code

source§

impl PalpableContent for Code

source§

impl PhrasingContent for Code

source§

impl StructuralPartialEq for Code

Auto Trait Implementations§

§

impl RefUnwindSafe for Code

§

impl Send for Code

§

impl Sync for Code

§

impl Unpin for Code

§

impl UnwindSafe for Code

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> ToOwned for Twhere T: Clone,

§

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.