pub struct RegExpData {
pub regex: Rc<Regex>,
pub source: Wtf8,
pub flags: String,
}Expand description
The compiled pattern an object of ObjectKind::RegExp carries.
Boxed through Rc because a RegExp object is shared by every reference to it and
the pattern is immutable once compiled.
Fields§
§regex: Rc<Regex>The compiled pattern, shared between exec calls.
source: Wtf8Pattern source as written, which .source reports.
WTF-8, not String: a pattern may legitimately contain a lone surrogate —
new RegExp("\ud800") compiles fine and .source has to give the same code unit
back (literals/regexp/S7.8.5_A1.1_T2, S7.8.5_A2.1_T2). A String would have
replaced it with U+FFFD on the way in.
flags: StringThe flags, in canonical order.
Trait Implementations§
Auto Trait Implementations§
impl !Send for RegExpData
impl !Sync for RegExpData
impl Forget for RegExpData
impl Freeze for RegExpData
impl Move for RegExpData
impl RefUnwindSafe for RegExpData
impl Unpin for RegExpData
impl UnsafeUnpin for RegExpDatawhere
*const RcInner<Regex> is !null: UnsafeUnpin,
PhantomData<RcInner<Regex>>: UnsafeUnpin,
*const RcInner<[u8]> is !null: UnsafeUnpin,
PhantomData<RcInner<[u8]>>: UnsafeUnpin,
*const RcInner<Vec<u8>> is !null: UnsafeUnpin,
PhantomData<RcInner<Vec<u8>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for RegExpDatawhere
Rc<Regex>: UnwindSafe,
Rc<[u8]>: UnwindSafe,
Rc<Vec<u8>>: UnwindSafe,
RawVecInner: UnwindSafe,
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