pub struct Array { /* private fields */ }
Implementations§
Source§impl Array
impl Array
Sourcepub fn into_object(self) -> Object
pub fn into_object(self) -> Object
Consumes the array and downgrades it to a JavaScript object.
Sourcepub fn get<V: FromValue>(&self, index: u32) -> Result<V>
pub fn get<V: FromValue>(&self, index: u32) -> Result<V>
Get the value using the given array index. Returns Value::Undefined
if no element at the
index exists.
Returns an error if FromValue::from_value
fails for the element.
Sourcepub fn set<V: ToValue>(&self, index: u32, value: V) -> Result<()>
pub fn set<V: ToValue>(&self, index: u32, value: V) -> Result<()>
Sets an array element using the given index and value.
Returns an error if ToValue::to_value
fails for the value.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Array
impl !RefUnwindSafe for Array
impl !Send for Array
impl !Sync for Array
impl Unpin for Array
impl !UnwindSafe for Array
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