pub struct CSSOMString { /* private fields */ }Expand description
Wrapper for WebIDL CSSOMString.
Implementations§
Source§impl CSSOMString
impl CSSOMString
Sourcepub fn char_at(&self, i: usize) -> Option<char>
pub fn char_at(&self, i: usize) -> Option<char>
Scalar lookup; returns None if index is out of bounds.
Sourcepub fn char_code_at(&self, idx: usize) -> u16
pub fn char_code_at(&self, idx: usize) -> u16
Returns the 16-bit code unit at idx (like charCodeAt).
pub fn set(&self, idx: usize, val: char)
Sourcepub fn code_point_at(&self, idx: usize) -> Option<u32>
pub fn code_point_at(&self, idx: usize) -> Option<u32>
Sourcepub fn index_of(&self, pat: &str) -> Option<usize>
pub fn index_of(&self, pat: &str) -> Option<usize>
String.prototype.indexOf
Returns None when not found.
Sourcepub fn is_well_formed(&self) -> bool
pub fn is_well_formed(&self) -> bool
Sourcepub fn last_index_of(&self, pat: &str) -> Option<usize>
pub fn last_index_of(&self, pat: &str) -> Option<usize>
Sourcepub fn locale_compare(&self, other: &str) -> i32
pub fn locale_compare(&self, other: &str) -> i32
Sourcepub fn replace_all(&self, pat: &Val, repl: &Val) -> Self
pub fn replace_all(&self, pat: &Val, repl: &Val) -> Self
Sourcepub fn starts_with(&self, pat: &str) -> bool
pub fn starts_with(&self, pat: &str) -> bool
Sourcepub fn to_locale_lower_case(&self) -> Self
pub fn to_locale_lower_case(&self) -> Self
Sourcepub fn to_locale_upper_case(&self) -> Self
pub fn to_locale_upper_case(&self) -> Self
Sourcepub fn to_lower_case(&self) -> Self
pub fn to_lower_case(&self) -> Self
Sourcepub fn to_upper_case(&self) -> Self
pub fn to_upper_case(&self) -> Self
Sourcepub fn to_well_formed(&self) -> Self
pub fn to_well_formed(&self) -> Self
Sourcepub fn trim_start(&self) -> Self
pub fn trim_start(&self) -> Self
Methods from Deref<Target = Val>§
Sourcepub fn has_own_property(&self, prop: &str) -> bool
pub fn has_own_property(&self, prop: &str) -> bool
Checks whether a non-inherited property prop exists
Sourcepub fn at<T>(&self, idx: T) -> Val
pub fn at<T>(&self, idx: T) -> Val
Gets the element at index idx. Assumes the underlying js type is indexable
Sourcepub fn to_vec<V>(&self) -> Vec<V>where
V: FromVal,
pub fn to_vec<V>(&self) -> Vec<V>where
V: FromVal,
Converts the underlying js array to a Vec of V
Sourcepub fn call(&self, f: &str, args: &[Val]) -> Val
pub fn call(&self, f: &str, args: &[Val]) -> Val
Calls the method f with args, can return an undefined js value
Sourcepub fn new(&self, args: &[Val]) -> Val
pub fn new(&self, args: &[Val]) -> Val
Calls the object’s constructor with args constructing a new object
Sourcepub fn invoke(&self, args: &[Val]) -> Val
pub fn invoke(&self, args: &[Val]) -> Val
Invokes the function object with args, can return an undefined js value
Sourcepub fn instanceof(&self, v: Val) -> bool
pub fn instanceof(&self, v: Val) -> bool
Checks whether this Val is an instanceof v
pub fn is_number(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_null(&self) -> bool
pub fn is_undefined(&self) -> bool
pub fn is_error(&self) -> bool
pub fn is_function(&self) -> bool
pub fn as_<T>(&self) -> Twhere
T: FromVal,
Trait Implementations§
Source§impl Add for CSSOMString
impl Add for CSSOMString
Source§impl AsMut<Val> for CSSOMString
impl AsMut<Val> for CSSOMString
Source§impl AsRef<Val> for CSSOMString
impl AsRef<Val> for CSSOMString
Source§impl AsRef<str> for CSSOMString
impl AsRef<str> for CSSOMString
Source§impl Clone for CSSOMString
impl Clone for CSSOMString
Source§fn clone(&self) -> CSSOMString
fn clone(&self) -> CSSOMString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CSSOMString
impl Debug for CSSOMString
Source§impl Deref for CSSOMString
impl Deref for CSSOMString
Source§impl DerefMut for CSSOMString
impl DerefMut for CSSOMString
Source§impl Display for CSSOMString
impl Display for CSSOMString
Source§impl DynCast for CSSOMString
impl DynCast for CSSOMString
Source§fn instanceof(val: &Val) -> bool
fn instanceof(val: &Val) -> bool
Implementation of
val instanceof ThisType.Source§fn unchecked_from_val(v: Val) -> Self
fn unchecked_from_val(v: Val) -> Self
Zero-cost unchecked conversion from
Val into Self.Source§fn unchecked_from_val_ref(v: &Val) -> &Self
fn unchecked_from_val_ref(v: &Val) -> &Self
Zero-cost unchecked conversion from
&Val into &Self.fn has_type<T>(&self) -> boolwhere
T: DynCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: DynCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: DynCast,
fn unchecked_into<T>(self) -> Twhere
T: DynCast,
fn unchecked_ref<T>(&self) -> &Twhere
T: DynCast,
fn is_instance_of<T>(&self) -> boolwhere
T: DynCast,
Source§fn is_type_of(val: &Val) -> bool
fn is_type_of(val: &Val) -> bool
Customisable brand check – defaults to
instanceof.Source§impl From<&str> for CSSOMString
impl From<&str> for CSSOMString
Source§impl From<CSSOMString> for Val
impl From<CSSOMString> for Val
Source§fn from(x: CSSOMString) -> Val
fn from(x: CSSOMString) -> Val
Converts to this type from the input type.
Source§impl From<String> for CSSOMString
impl From<String> for CSSOMString
Source§impl FromVal for CSSOMString
impl FromVal for CSSOMString
Source§impl PartialEq<str> for CSSOMString
impl PartialEq<str> for CSSOMString
Source§impl PartialEq for CSSOMString
impl PartialEq for CSSOMString
Source§impl PartialOrd for CSSOMString
impl PartialOrd for CSSOMString
impl StructuralPartialEq for CSSOMString
Auto Trait Implementations§
impl Freeze for CSSOMString
impl RefUnwindSafe for CSSOMString
impl Send for CSSOMString
impl Sync for CSSOMString
impl Unpin for CSSOMString
impl UnwindSafe for CSSOMString
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