Struct RegExpMatchArray

#[repr(transparent)]
pub struct RegExpMatchArray { /* private fields */ }

The result array from RegExp.exec() or String.matchAll().

This is an array of strings with additional properties index, input, and groups.

MDN documentation

Implementations

impl RegExpMatchArray

fn input(&self) -> JsString

The original string that was matched against.

impl RegExpMatchArray

fn get(&self, index: u32) -> Option<JsString>

Gets the matched string or capture group at the given index. Index 0 is the full match, indices 1+ are capture groups.

impl RegExpMatchArray

fn groups(&self) -> Option<Object>

An object of named capturing groups whose keys are the names and valuestype Array are the capturing groups, or undefined if no named capturing groups were defined.

impl RegExpMatchArray

fn index(&self) -> u32

The 0-based index of the match in the string.

impl RegExpMatchArray

fn length(&self) -> u32

The number of elements in the match array (full match + capture groups).

Trait Implementations

impl AsRef<Array> for RegExpMatchArray

fn as_ref(&self) -> &Array

impl AsRef<JsValue> for RegExpMatchArray

fn as_ref(&self) -> &JsValue

impl AsRef<Object> for RegExpMatchArray

fn as_ref(&self) -> &Object

impl AsRef<RegExpMatchArray> for RegExpMatchArray

fn as_ref(&self) -> &RegExpMatchArray

impl Clone for RegExpMatchArray

fn clone(&self) -> Self

impl Debug for RegExpMatchArray

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

impl Deref for RegExpMatchArray

type Target = Object;
fn deref(&self) -> &Object

impl Eq for RegExpMatchArray

impl ErasableGeneric for RegExpMatchArray

type Repr = JsValue;

impl From<JsValue> for RegExpMatchArray

fn from(obj: JsValue) -> Self

impl FromWasmAbi for RegExpMatchArray

type Abi = <JsValue as FromWasmAbi>::Abi;
unsafe fn from_abi(js: Self::Abi) -> Self

impl IntoJsGeneric for RegExpMatchArray where RegExpMatchArray: JsGeneric,

type JsCanon = RegExpMatchArray;
fn to_js(self) -> RegExpMatchArray

impl IntoWasmAbi for RegExpMatchArray

type Abi = <JsValue as IntoWasmAbi>::Abi;
fn into_abi(self) -> Self::Abi

impl JsCast for RegExpMatchArray

fn instanceof(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self

impl LongRefFromWasmAbi for RegExpMatchArray

type Abi = <JsValue as LongRefFromWasmAbi>::Abi;
type Anchor = RegExpMatchArray;
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

impl OptionFromWasmAbi for RegExpMatchArray

fn is_none(abi: &Self::Abi) -> bool

impl OptionIntoWasmAbi for RegExpMatchArray

fn none() -> Self::Abi

impl PartialEq for RegExpMatchArray

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

impl Promising for RegExpMatchArray

type Resolution = RegExpMatchArray;

impl RefFromWasmAbi for RegExpMatchArray

type Abi = <JsValue as RefFromWasmAbi>::Abi;
type Anchor = ManuallyDrop<RegExpMatchArray>;
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

impl StructuralPartialEq for RegExpMatchArray

impl UpcastFrom<RegExpMatchArray> for RegExpMatchArray

impl WasmDescribe for RegExpMatchArray

fn describe()

Auto Trait Implementations

impl Freeze for RegExpMatchArray

impl RefUnwindSafe for RegExpMatchArray

impl Send for RegExpMatchArray

impl Sync for RegExpMatchArray

impl Unpin for RegExpMatchArray

impl UnsafeUnpin for RegExpMatchArray

impl UnwindSafe for RegExpMatchArray

Blanket Implementations

impl<P, T> Receiver for RegExpMatchArray where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for RegExpMatchArray where T: UpcastFrom<S> + ?Sized, S: ?Sized,

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

impl<T> Borrow<T> for RegExpMatchArray where T: ?Sized,

impl<T> BorrowMut<T> for RegExpMatchArray where T: ?Sized,

impl<T> CloneToUninit for RegExpMatchArray where T: Clone,

impl<T> From<T> for RegExpMatchArray

impl<T> JsGeneric for RegExpMatchArray where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for RegExpMatchArray where T: IntoWasmAbi,

impl<T> ToOwned for RegExpMatchArray where T: Clone,

impl<T> TryFromJsValue for RegExpMatchArray where T: JsCast,

impl<T> VectorFromWasmAbi for RegExpMatchArray where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for RegExpMatchArray where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for RegExpMatchArray where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for RegExpMatchArray where U: From<T>,

impl<T, U> TryFrom<U> for RegExpMatchArray where U: Into<T>,

impl<T, U> TryInto<U> for RegExpMatchArray where U: TryFrom<T>,