Skip to main content

CompoundSel

Struct CompoundSel 

Source
struct CompoundSel {
    tag: Option<String>,
    id: Option<String>,
    classes: Vec<String>,
    attrs: Vec<AttrSel>,
    not: Vec<CompoundSel>,
    is_list: Vec<CompoundSel>,
    pos: Vec<PosPseudo>,
    pos_of_type: Vec<PosPseudo>,
    is_scope: bool,
}

Fields§

§tag: Option<String>§id: Option<String>§classes: Vec<String>§attrs: Vec<AttrSel>§not: Vec<CompoundSel>

:not(sel1, sel2, ...) の中身(コンパウンドセレクタのみ対応。結合子を含む 複雑なセレクタは非対応)。いずれか1つでも一致すれば不一致とする。

§is_list: Vec<CompoundSel>

:is(sel1, sel2, ...)/:where(...) の中身(コンパウンドセレクタのみ対応。 仕様上 :where() は詳細度の扱いのみ :is() と異なるが、この処理系は 詳細度を計算しないためマッチ判定は完全に同一として扱う)。いずれか1つでも 一致すれば一致とする(空なら制約なし = 常に一致)。

§pos: Vec<PosPseudo>

:first-child/:last-child/:only-child/:nth-child(...)

§pos_of_type: Vec<PosPseudo>

:first-of-type/:last-of-type/:only-of-type/:nth-of-type(...) (タグ名が同じ兄弟のみを数える点以外は pos と同じ規則)。

§is_scope: bool

:scope(Selectors Level 4。丸ごと未対応だった)。マッチ時に呼び出し元が 渡す scope_rootelement.querySelectorAll/matches/closest 等の 起点ノード)と一致する場合のみ真になる。詳細は compound_matches 参照。

Trait Implementations§

Source§

impl Default for CompoundSel

Source§

fn default() -> CompoundSel

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

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

Source§

type Output = T

Should always be Self
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.