pub struct JsSharedArrayBuffer {/* private fields */ }Expand description
JsSharedArrayBuffer provides a wrapper for Boa’s implementation of the ECMAScriptArrayBuffer object
Implementations§
Source§implJsSharedArrayBuffer
implJsSharedArrayBuffer
Sourcepub fnnew(byte_length:usize, context: &mutContext) ->JsResult<Self>
pub fnnew(byte_length:usize, context: &mutContext) ->JsResult<Self>
Creates a newJsSharedArrayBuffer withbyte_length bytes of allocated space.
Sourcepub fnfrom_buffer(buffer:SharedArrayBuffer, context: &mutContext) -> Self
pub fnfrom_buffer(buffer:SharedArrayBuffer, context: &mutContext) -> Self
Creates aJsSharedArrayBuffer from a shared raw buffer.
Sourcepub fnfrom_object(object:JsObject) ->JsResult<Self>
pub fnfrom_object(object:JsObject) ->JsResult<Self>
Creates aJsSharedArrayBuffer from aJsObject, throwing aTypeError if the objectis not a shared array buffer.
This does not clone the fields of the shared array buffer, it only does a shallow clone ofthe object.
Sourcepub fnbyte_length(&self) ->usize
pub fnbyte_length(&self) ->usize
Returns the byte length of the array buffer.
Sourcepub fninner(&self) ->SharedArrayBuffer
pub fninner(&self) ->SharedArrayBuffer
Gets the raw buffer of thisJsSharedArrayBuffer.
Methods fromDeref<Target =JsObject<SharedArrayBuffer>>§
Sourcepub fndowncast_ref<T:NativeObject>(&self) ->Option<Ref<'_, T>>
pub fndowncast_ref<T:NativeObject>(&self) ->Option<Ref<'_, T>>
Downcasts a reference to the object,if the object is of typeT.
§Panics
Panics if the object is currently mutably borrowed.
Sourcepub fndowncast_mut<T:NativeObject>(&self) ->Option<RefMut<'_, T>>
pub fndowncast_mut<T:NativeObject>(&self) ->Option<RefMut<'_, T>>
Downcasts a mutable reference to the object,if the object is type native object typeT.
§Panics
Panics if the object is currently borrowed.
Sourcepub fnis<T:NativeObject>(&self) ->bool
pub fnis<T:NativeObject>(&self) ->bool
Checks if this object is an instance of a certainNativeObject.
§Panics
Panics if the object is currently mutably borrowed.
Sourcepub fnis_ordinary(&self) ->bool
pub fnis_ordinary(&self) ->bool
Sourcepub fnto_property_descriptor( &self, context: &mutContext,) ->JsResult<PropertyDescriptor>
pub fnto_property_descriptor( &self, context: &mutContext,) ->JsResult<PropertyDescriptor>
Sourcepub fncopy_data_properties<K>( &self, source: &JsValue, excluded_keys:Vec<K>, context: &mutContext,) ->JsResult<()>where K:Into<PropertyKey>,
pub fncopy_data_properties<K>( &self, source: &JsValue, excluded_keys:Vec<K>, context: &mutContext,) ->JsResult<()>where K:Into<PropertyKey>,
Sourcepub fnborrow(&self) ->Ref<'_,Object<T>>
pub fnborrow(&self) ->Ref<'_,Object<T>>
Immutably borrows theObject.
The borrow lasts until the returnedRef exits scope.Multiple immutable borrows can be taken out at the same time.
§Panics
Panics if the object is currently mutably borrowed.
Sourcepub fnborrow_mut(&self) ->RefMut<'_,Object<T>>
pub fnborrow_mut(&self) ->RefMut<'_,Object<T>>
Mutably borrows the Object.
The borrow lasts until the returnedRefMut exits scope.The object cannot be borrowed while this borrow is active.
§Panics
Panics if the object is currently borrowed.
Sourcepub fntry_borrow(&self) ->StdResult<Ref<'_,Object<T>>,BorrowError>
pub fntry_borrow(&self) ->StdResult<Ref<'_,Object<T>>,BorrowError>
Immutably borrows theObject, returning an error if the value is currently mutably borrowed.
The borrow lasts until the returnedGcCellRef exits scope.Multiple immutable borrows can be taken out at the same time.
This is the non-panicking variant ofborrow.
Sourcepub fntry_borrow_mut(&self) ->StdResult<RefMut<'_,Object<T>>,BorrowMutError>
pub fntry_borrow_mut(&self) ->StdResult<RefMut<'_,Object<T>>,BorrowMutError>
Mutably borrows the object, returning an error if the value is currently borrowed.
The borrow lasts until the returnedGcCellRefMut exits scope.The object be borrowed while this borrow is active.
This is the non-panicking variant ofborrow_mut.
Sourcepub fnprototype(&self) ->JsPrototype
pub fnprototype(&self) ->JsPrototype
Sourcepub fnset_prototype(&self, prototype:JsPrototype) ->bool
pub fnset_prototype(&self, prototype:JsPrototype) ->bool
Sourcepub fninsert_property<K, P>(&self, key: K, property: P) ->bool
pub fninsert_property<K, P>(&self, key: K, property: P) ->bool
Inserts a field in the objectproperties without checking if it’s writable.
If a field was already in the object with the same name, thantrue is returnedwith that field, otherwisefalse is returned.
Sourcepub fnis_callable(&self) ->bool
pub fnis_callable(&self) ->bool
It determines if Object is a callable function with a[[Call]] internal method.
More information:
Sourcepub fnis_constructor(&self) ->bool
pub fnis_constructor(&self) ->bool
It determines if Object is a function object with a[[Construct]] internal method.
More information:
Sourcepub fnis_extensible(&self, context: &mutContext) ->JsResult<bool>
pub fnis_extensible(&self, context: &mutContext) ->JsResult<bool>
Sourcepub fnget<K>(&self, key: K, context: &mutContext) ->JsResult<JsValue>where K:Into<PropertyKey>,
pub fnget<K>(&self, key: K, context: &mutContext) ->JsResult<JsValue>where K:Into<PropertyKey>,
Sourcepub fncreate_data_property<K, V>( &self, key: K, value: V, context: &mutContext,) ->JsResult<bool>
pub fncreate_data_property<K, V>( &self, key: K, value: V, context: &mutContext,) ->JsResult<bool>
Sourcepub fncreate_data_property_or_throw<K, V>( &self, key: K, value: V, context: &mutContext,) ->JsResult<bool>
pub fncreate_data_property_or_throw<K, V>( &self, key: K, value: V, context: &mutContext,) ->JsResult<bool>
Sourcepub fndefine_property_or_throw<K, P>( &self, key: K, desc: P, context: &mutContext,) ->JsResult<bool>
pub fndefine_property_or_throw<K, P>( &self, key: K, desc: P, context: &mutContext,) ->JsResult<bool>
Sourcepub fndelete_property_or_throw<K>( &self, key: K, context: &mutContext,) ->JsResult<bool>where K:Into<PropertyKey>,
pub fndelete_property_or_throw<K>( &self, key: K, context: &mutContext,) ->JsResult<bool>where K:Into<PropertyKey>,
Defines the property or throws aTypeError if the operation fails.
More information:
Sourcepub fnhas_property<K>(&self, key: K, context: &mutContext) ->JsResult<bool>where K:Into<PropertyKey>,
pub fnhas_property<K>(&self, key: K, context: &mutContext) ->JsResult<bool>where K:Into<PropertyKey>,
Sourcepub fnhas_own_property<K>( &self, key: K, context: &mutContext,) ->JsResult<bool>where K:Into<PropertyKey>,
pub fnhas_own_property<K>( &self, key: K, context: &mutContext,) ->JsResult<bool>where K:Into<PropertyKey>,
Sourcepub fnown_property_keys( &self, context: &mutContext,) ->JsResult<Vec<PropertyKey>>
pub fnown_property_keys( &self, context: &mutContext,) ->JsResult<Vec<PropertyKey>>
Sourcepub fncall( &self, this: &JsValue, args: &[JsValue], context: &mutContext,) ->JsResult<JsValue>
pub fncall( &self, this: &JsValue, args: &[JsValue], context: &mutContext,) ->JsResult<JsValue>
Call ( F, V [ , argumentsList ] )
§Panics
Panics if the object is currently mutably borrowed.
More information:
Sourcepub fnconstruct( &self, args: &[JsValue], new_target:Option<&Self>, context: &mutContext,) ->JsResult<Self>
pub fnconstruct( &self, args: &[JsValue], new_target:Option<&Self>, context: &mutContext,) ->JsResult<Self>
Construct ( F [ , argumentsList [ , newTarget ] ] )
Construct an instance of this object with the specified arguments.
§Panics
Panics if the object is currently mutably borrowed.
More information:
Sourcepub fnset_integrity_level( &self, level:IntegrityLevel, context: &mutContext,) ->JsResult<bool>
pub fnset_integrity_level( &self, level:IntegrityLevel, context: &mutContext,) ->JsResult<bool>
Sourcepub fntest_integrity_level( &self, level:IntegrityLevel, context: &mutContext,) ->JsResult<bool>
pub fntest_integrity_level( &self, level:IntegrityLevel, context: &mutContext,) ->JsResult<bool>
Trait Implementations§
Source§implClone forJsSharedArrayBuffer
implClone forJsSharedArrayBuffer
Source§fnclone(&self) ->JsSharedArrayBuffer
fnclone(&self) ->JsSharedArrayBuffer
1.0.0 ·Source§fnclone_from(&mut self, source: &Self)
fnclone_from(&mut self, source: &Self)
source.Read moreSource§implDebug forJsSharedArrayBuffer
implDebug forJsSharedArrayBuffer
Source§implDeref forJsSharedArrayBuffer
implDeref forJsSharedArrayBuffer
Source§implFrom<JsObject<SharedArrayBuffer>> forJsSharedArrayBuffer
implFrom<JsObject<SharedArrayBuffer>> forJsSharedArrayBuffer
Source§fnfrom(value:JsObject<SharedArrayBuffer>) -> Self
fnfrom(value:JsObject<SharedArrayBuffer>) -> Self
Source§implFrom<JsSharedArrayBuffer> forJsObject
implFrom<JsSharedArrayBuffer> forJsObject
Source§fnfrom(o:JsSharedArrayBuffer) -> Self
fnfrom(o:JsSharedArrayBuffer) -> Self
Source§implFrom<JsSharedArrayBuffer> forJsObject<SharedArrayBuffer>
implFrom<JsSharedArrayBuffer> forJsObject<SharedArrayBuffer>
Source§fnfrom(value:JsSharedArrayBuffer) -> Self
fnfrom(value:JsSharedArrayBuffer) -> Self
Source§implFrom<JsSharedArrayBuffer> forJsValue
implFrom<JsSharedArrayBuffer> forJsValue
Source§fnfrom(o:JsSharedArrayBuffer) -> Self
fnfrom(o:JsSharedArrayBuffer) -> Self
Source§implTrace forJsSharedArrayBuffer
implTrace forJsSharedArrayBuffer
Source§unsafe fntrace_non_roots(&self)
unsafe fntrace_non_roots(&self)
Source§fnrun_finalizer(&self)
fnrun_finalizer(&self)
Finalize::finalize on this object and allcontained subobjects.Auto Trait Implementations§
implFreeze forJsSharedArrayBuffer
impl !RefUnwindSafe forJsSharedArrayBuffer
impl !Send forJsSharedArrayBuffer
impl !Sync forJsSharedArrayBuffer
implUnpin forJsSharedArrayBuffer
impl !UnwindSafe forJsSharedArrayBuffer
Blanket Implementations§
Source§impl<T>BorrowMut<T> for Twhere T: ?Sized,
impl<T>BorrowMut<T> for Twhere T: ?Sized,
Source§fnborrow_mut(&mut self) ->&mut T
fnborrow_mut(&mut self) ->&mut T
Source§impl<T>CloneToUninit for Twhere T:Clone,
impl<T>CloneToUninit for Twhere T:Clone,
Source§impl<T>IntoEither for T
impl<T>IntoEither for T
Source§fninto_either(self, into_left:bool) ->Either<Self, Self>
fninto_either(self, into_left:bool) ->Either<Self, Self>
self into aLeft variant ofEither<Self, Self>ifinto_left istrue.Convertsself into aRight variant ofEither<Self, Self>otherwise.Read moreSource§fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>
fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>
self into aLeft variant ofEither<Self, Self>ifinto_left(&self) returnstrue.Convertsself into aRight variant ofEither<Self, Self>otherwise.Read moreSource§impl<T>Pipe for Twhere T: ?Sized,
impl<T>Pipe for Twhere T: ?Sized,
Source§fnpipe<R>(self, func: implFnOnce(Self) -> R) -> Rwhere Self:Sized,
fnpipe<R>(self, func: implFnOnce(Self) -> R) -> Rwhere Self:Sized,
Source§fnpipe_ref<'a, R>(&'a self, func: implFnOnce(&'a Self) -> R) -> Rwhere R: 'a,
fnpipe_ref<'a, R>(&'a self, func: implFnOnce(&'a Self) -> R) -> Rwhere R: 'a,
self and passes that borrow into the pipe function.Read moreSource§fnpipe_ref_mut<'a, R>(&'a mut self, func: implFnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
fnpipe_ref_mut<'a, R>(&'a mut self, func: implFnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
self and passes that borrow into the pipe function.Read moreSource§fnpipe_borrow<'a, B, R>(&'a self, func: implFnOnce(&'a B) -> R) -> R
fnpipe_borrow<'a, B, R>(&'a self, func: implFnOnce(&'a B) -> R) -> R
Source§fnpipe_borrow_mut<'a, B, R>( &'a mut self, func: implFnOnce(&'a mut B) -> R,) -> R
fnpipe_borrow_mut<'a, B, R>( &'a mut self, func: implFnOnce(&'a mut B) -> R,) -> R
Source§fnpipe_as_ref<'a, U, R>(&'a self, func: implFnOnce(&'a U) -> R) -> R
fnpipe_as_ref<'a, U, R>(&'a self, func: implFnOnce(&'a U) -> R) -> R
self, then passesself.as_ref() into the pipe function.Source§fnpipe_as_mut<'a, U, R>(&'a mut self, func: implFnOnce(&'a mut U) -> R) -> R
fnpipe_as_mut<'a, U, R>(&'a mut self, func: implFnOnce(&'a mut U) -> R) -> R
self, then passesself.as_mut() into the pipefunction.Source§fnpipe_deref<'a, T, R>(&'a self, func: implFnOnce(&'a T) -> R) -> R
fnpipe_deref<'a, T, R>(&'a self, func: implFnOnce(&'a T) -> R) -> R
self, then passesself.deref() into the pipe function.Source§impl<T>Tap for T
impl<T>Tap for T
Source§fntap_borrow<B>(self, func: implFnOnce(&B)) -> Self
fntap_borrow<B>(self, func: implFnOnce(&B)) -> Self
Borrow<B> of a value.Read moreSource§fntap_borrow_mut<B>(self, func: implFnOnce(&mut B)) -> Self
fntap_borrow_mut<B>(self, func: implFnOnce(&mut B)) -> Self
BorrowMut<B> of a value.Read moreSource§fntap_ref<R>(self, func: implFnOnce(&R)) -> Self
fntap_ref<R>(self, func: implFnOnce(&R)) -> Self
AsRef<R> view of a value.Read moreSource§fntap_ref_mut<R>(self, func: implFnOnce(&mut R)) -> Self
fntap_ref_mut<R>(self, func: implFnOnce(&mut R)) -> Self
AsMut<R> view of a value.Read moreSource§fntap_deref<T>(self, func: implFnOnce(&T)) -> Self
fntap_deref<T>(self, func: implFnOnce(&T)) -> Self
Deref::Target of a value.Read moreSource§fntap_deref_mut<T>(self, func: implFnOnce(&mut T)) -> Self
fntap_deref_mut<T>(self, func: implFnOnce(&mut T)) -> Self
Deref::Target of a value.Read moreSource§fntap_dbg(self, func: implFnOnce(&Self)) -> Self
fntap_dbg(self, func: implFnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fntap_mut_dbg(self, func: implFnOnce(&mut Self)) -> Self
fntap_mut_dbg(self, func: implFnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in releasebuilds.Source§fntap_borrow_dbg<B>(self, func: implFnOnce(&B)) -> Self
fntap_borrow_dbg<B>(self, func: implFnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in releasebuilds.Source§fntap_borrow_mut_dbg<B>(self, func: implFnOnce(&mut B)) -> Self
fntap_borrow_mut_dbg<B>(self, func: implFnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in releasebuilds.Source§fntap_ref_dbg<R>(self, func: implFnOnce(&R)) -> Self
fntap_ref_dbg<R>(self, func: implFnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in releasebuilds.Source§fntap_ref_mut_dbg<R>(self, func: implFnOnce(&mut R)) -> Self
fntap_ref_mut_dbg<R>(self, func: implFnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in releasebuilds.Source§fntap_deref_dbg<T>(self, func: implFnOnce(&T)) -> Self
fntap_deref_dbg<T>(self, func: implFnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in releasebuilds.