pub struct ByteString { /* private fields */ }Expand description
Wrapper for WebIDL ByteString.
Implementations§
Source§impl ByteString
impl ByteString
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 as_<T>(&self) -> Twhere
T: FromVal,
Trait Implementations§
Source§impl Add for ByteString
impl Add for ByteString
Source§impl AsRef<str> for ByteString
impl AsRef<str> for ByteString
Source§impl Clone for ByteString
impl Clone for ByteString
Source§fn clone(&self) -> ByteString
fn clone(&self) -> ByteString
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 ByteString
impl Debug for ByteString
Source§impl Deref for ByteString
impl Deref for ByteString
Source§impl DerefMut for ByteString
impl DerefMut for ByteString
Source§impl Display for ByteString
impl Display for ByteString
Source§impl From<&str> for ByteString
impl From<&str> for ByteString
Source§impl From<ByteString> for Val
impl From<ByteString> for Val
Source§fn from(x: ByteString) -> Val
fn from(x: ByteString) -> Val
Converts to this type from the input type.
Source§impl From<String> for ByteString
impl From<String> for ByteString
Source§impl FromVal for ByteString
impl FromVal for ByteString
Source§impl PartialEq<str> for ByteString
impl PartialEq<str> for ByteString
Auto Trait Implementations§
impl Freeze for ByteString
impl RefUnwindSafe for ByteString
impl Send for ByteString
impl Sync for ByteString
impl Unpin for ByteString
impl UnwindSafe for ByteString
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