Struct script::dom::servoparser::async_html::Sink

source ·
pub struct Sink {
    current_line: Cell<u64>,
    parse_node_data: RefCell<HashMap<usize, ParseNodeData>>,
    next_parse_node_id: Cell<usize>,
    document_node: ParseNode,
    sender: Sender<ToTokenizerMsg>,
}

Fields§

§current_line: Cell<u64>§parse_node_data: RefCell<HashMap<usize, ParseNodeData>>§next_parse_node_id: Cell<usize>§document_node: ParseNode§sender: Sender<ToTokenizerMsg>

Implementations§

Trait Implementations§

source§

impl TreeSink for Sink

source§

fn is_mathml_annotation_xml_integration_point( &self, handle: &Self::Handle, ) -> bool

https://html.spec.whatwg.org/multipage/#html-integration-point Specifically, the <annotation-xml> cases.

§

type Output = Sink

The overall result of parsing. Read more
source§

fn finish(self) -> Self

Consume this sink and return the overall result of parsing. Read more
§

type Handle = ParseNode

Handle is a reference to a DOM node. The tree builder requires that a Handle implements Clone to get another reference to the same node.
§

type ElemName<'a> = ExpandedName<'a> where Self: 'a

source§

fn get_document(&self) -> Self::Handle

Get a handle to the Document node.
source§

fn get_template_contents(&self, target: &Self::Handle) -> Self::Handle

Get a handle to a template’s template contents. The tree builder promises this will never be called with something else than a template element.
source§

fn same_node(&self, x: &Self::Handle, y: &Self::Handle) -> bool

Do two handles refer to the same node?
source§

fn elem_name<'a>(&self, target: &'a Self::Handle) -> ExpandedName<'a>

What is the name of this element? Read more
source§

fn create_element( &self, name: QualName, html_attrs: Vec<HtmlAttribute>, _flags: ElementFlags, ) -> Self::Handle

Create an element. Read more
source§

fn create_comment(&self, text: StrTendril) -> Self::Handle

Create a comment node.
source§

fn create_pi(&self, target: StrTendril, data: StrTendril) -> ParseNode

Create a Processing Instruction node.
source§

fn associate_with_form( &self, target: &Self::Handle, form: &Self::Handle, nodes: (&Self::Handle, Option<&Self::Handle>), )

Associate the given form-associatable element with the form element
source§

fn append_before_sibling( &self, sibling: &Self::Handle, new_node: HtmlNodeOrText<Self::Handle>, )

Append a node as the sibling immediately before the given node. Read more
source§

fn append_based_on_parent_node( &self, elem: &Self::Handle, prev_elem: &Self::Handle, child: HtmlNodeOrText<Self::Handle>, )

When the insertion point is decided by the existence of a parent node of the element, we consider both possibilities and send the element which will be used if a parent node exists, along with the element to be used if there isn’t one.
source§

fn parse_error(&self, msg: Cow<'static, str>)

Signal a parse error.
source§

fn set_quirks_mode(&self, mode: QuirksMode)

Set the document’s quirks mode.
source§

fn append(&self, parent: &Self::Handle, child: HtmlNodeOrText<Self::Handle>)

Append a node as the last child of the given node. If this would produce adjacent sibling text nodes, it should concatenate the text instead. Read more
source§

fn append_doctype_to_document( &self, name: StrTendril, public_id: StrTendril, system_id: StrTendril, )

Append a DOCTYPE element to the Document node.
source§

fn add_attrs_if_missing( &self, target: &Self::Handle, html_attrs: Vec<HtmlAttribute>, )

Add each attribute to the given element, if no attribute with that name already exists. The tree builder promises this will never be called with something else than an element.
source§

fn remove_from_parent(&self, target: &Self::Handle)

Detach the given node from its parent.
source§

fn mark_script_already_started(&self, node: &Self::Handle)

Mark a HTML <script> as “already started”.
source§

fn complete_script(&self, _: &Self::Handle) -> NextParserState

Indicate that a script element is complete.
source§

fn reparent_children(&self, parent: &Self::Handle, new_parent: &Self::Handle)

Remove all the children from node and append them to new_parent.
source§

fn set_current_line(&self, line_number: u64)

Called whenever the line number changes.
source§

fn pop(&self, node: &Self::Handle)

Indicate that a node was popped off the stack of open elements.

Auto Trait Implementations§

§

impl !Freeze for Sink

§

impl !RefUnwindSafe for Sink

§

impl Send for Sink

§

impl !Sync for Sink

§

impl Unpin for Sink

§

impl UnwindSafe for Sink

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> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> Filterable for T

source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
§

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> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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

source§

impl<T> MaybeSendSync for T

source§

impl<T> WasmNotSend for T
where T: Send,