Movatterモバイル変換


[0]ホーム

URL:


Docs.rs

JsInt8Array

StructJsInt8Array 

Source
pub struct JsInt8Array {/* private fields */ }
Expand description

JsInt8Array provides a wrapper for Boa’s implementation of the ECMAScriptInt8Array builtin object.

Implementations§

Source§

implJsInt8Array

Source

pub fnfrom_object(object:JsObject) ->JsResult<Self>

Creates aJsInt8Array using aJsObject. It will make sure that the object is of the correct kind.

Source

pub fnfrom_array_buffer( array_buffer:JsArrayBuffer, context: &mutContext,) ->JsResult<Self>

Create the typed array from aJsArrayBuffer.

Source

pub fnfrom_shared_array_buffer( buffer:JsSharedArrayBuffer, context: &mutContext,) ->JsResult<Self>

Create the typed array from aJsSharedArrayBuffer.

Source

pub fnfrom_iter<I>(elements: I, context: &mutContext) ->JsResult<Self>
where I:IntoIterator<Item =i8>,

Create the typed array from an iterator.

Source

pub fniter<'a>( &'a self, context: &'a mutContext,) -> implIterator<Item =i8> + 'a

Create an iterator over the typed array’s elements.

Methods fromDeref<Target =JsTypedArray>§

Source

pub fnkind(&self) ->Option<TypedArrayKind>

Return the kind of typed array this is. This can be used in conjunction withjs_typed_array_from_kind to create a typed array of the same kind.

Source

pub fnlength(&self, context: &mutContext) ->JsResult<usize>

Get the length of the array.

Same asarray.length in JavaScript.

Source

pub fnis_empty(&self, context: &mutContext) ->JsResult<bool>

Check if the array is empty, i.e. thelength is zero.

Source

pub fnat<T>(&self, index: T, context: &mutContext) ->JsResult<JsValue>
where T:Into<i64>,

CallsTypedArray.prototype.at().

Source

pub fnbuffer(&self, context: &mutContext) ->JsResult<JsValue>

Returns theArrayBuffer referenced by this typed array at construction time.

CallsTypedArray.prototype.buffer().

§Examples
letcontext =&mutContext::default();letarray_buffer8 = JsArrayBuffer::new(8, context)?;letarray = JsUint8Array::from_array_buffer(array_buffer8, context)?;assert_eq!(    array.buffer(context)?.as_object().unwrap().get(PropertyKey::String(js_string!("byteLength")), context).unwrap(),    JsValue::new(8));
Source

pub fnbyte_length(&self, context: &mutContext) ->JsResult<usize>

ReturnsTypedArray.prototype.byteLength.

Source

pub fnbyte_offset(&self, context: &mutContext) ->JsResult<usize>

ReturnsTypedArray.prototype.byteOffset.

Source

pub fnconstructor(&self, context: &mutContext) ->JsResult<JsValue>

Function that created the instance object. It is the hiddenTypedArray constructor function,but each typed array subclass also defines its own constructor property.

ReturnsTypedArray.prototype.constructor.

§Examples
letcontext =&mutContext::default();letarray = JsUint8Array::from_iter(vec![1,2,3,4,5], context)?;assert_eq!(Err(JsNativeError::typ()        .with_message("the TypedArray constructor should never be called directly")        .into()),    array.constructor(context));
Source

pub fncopy_within<T>( &self, target: T, start:u64, end:Option<u64>, context: &mutContext,) ->JsResult<Self>
where T:Into<JsValue>,

Shallow copies part of this typed array to another location in the same typedarray and returns this typed array without modifying its length.

ReturnsTypedArray.prototype.copyWithin().

§Examples
letcontext =&mutContext::default();letarray = JsUint8Array::from_iter(vec![1u8,2u8,3u8,4u8,5u8,6u8,7u8,8u8], context)?;array.copy_within(3,1,Some(3), context)?;assert_eq!(array.get(0, context)?, JsValue::new(1.0));assert_eq!(array.get(1, context)?, JsValue::new(2.0));assert_eq!(array.get(2, context)?, JsValue::new(3.0));assert_eq!(array.get(3, context)?, JsValue::new(2.0));assert_eq!(array.get(4, context)?, JsValue::new(3.0));assert_eq!(array.get(5, context)?, JsValue::new(6.0));assert_eq!(array.get(6, context)?, JsValue::new(7.0));assert_eq!(array.get(7, context)?, JsValue::new(8.0));
Source

pub fnfill<T>( &self, value: T, start:Option<usize>, end:Option<usize>, context: &mutContext,) ->JsResult<Self>
where T:Into<JsValue>,

CallsTypedArray.prototype.fill().

Source

pub fnevery( &self, predicate:JsFunction, this_arg:Option<JsValue>, context: &mutContext,) ->JsResult<bool>

CallsTypedArray.prototype.every().

Source

pub fnsome( &self, callback:JsFunction, this_arg:Option<JsValue>, context: &mutContext,) ->JsResult<bool>

CallsTypedArray.prototype.some().

Source

pub fnsort( &self, compare_fn:Option<JsFunction>, context: &mutContext,) ->JsResult<Self>

CallsTypedArray.prototype.sort().

Source

pub fnsubarray( &self, begin:i64, end:i64, context: &mutContext,) ->JsResult<Self>

Returns a new typed array on the sameArrayBuffer store and with the same elementtypes as for this typed array.The begin offset is inclusive and the end offset is exclusive.

CallsTypedArray.prototype.subarray().

§Examples
letcontext =&mutContext::default();letarray = JsUint8Array::from_iter(vec![1u8,2u8,3u8,4u8,5u8,6u8,7u8,8u8], context)?;letsubarray2_6 = array.subarray(2,6, context)?;assert_eq!(subarray2_6.length(context)?,4);assert_eq!(subarray2_6.get(0, context)?, JsValue::new(3.0));assert_eq!(subarray2_6.get(1, context)?, JsValue::new(4.0));assert_eq!(subarray2_6.get(2, context)?, JsValue::new(5.0));assert_eq!(subarray2_6.get(3, context)?, JsValue::new(6.0));letsubarray4_6 = array.subarray(-4,6, context)?;assert_eq!(subarray4_6.length(context)?,2);assert_eq!(subarray4_6.get(0, context)?, JsValue::new(5.0));assert_eq!(subarray4_6.get(1, context)?, JsValue::new(6.0));
Source

pub fnto_locale_string( &self, reserved1:Option<JsValue>, reserved2:Option<JsValue>, context: &mutContext,) ->JsResult<JsValue>

CallsTypedArray.prototype.toLocaleString()

Source

pub fnfilter( &self, callback:JsFunction, this_arg:Option<JsValue>, context: &mutContext,) ->JsResult<Self>

CallsTypedArray.prototype.filter().

Source

pub fnmap( &self, callback:JsFunction, this_arg:Option<JsValue>, context: &mutContext,) ->JsResult<Self>

CallsTypedArray.prototype.map().

Source

pub fnreduce( &self, callback:JsFunction, initial_value:Option<JsValue>, context: &mutContext,) ->JsResult<JsValue>

CallsTypedArray.prototype.reduce().

Source

pub fnreduce_right( &self, callback:JsFunction, initial_value:Option<JsValue>, context: &mutContext,) ->JsResult<JsValue>

CallsTypedArray.prototype.reduceRight().

Source

pub fnreverse(&self, context: &mutContext) ->JsResult<Self>

CallsTypedArray.prototype.reverse().

Source

pub fnset_values( &self, source:JsValue, offset:Option<u64>, context: &mutContext,) ->JsResult<JsValue>

Stores multiple values in the typed array, reading input values from a specified array.

ReturnsTypedArray.prototype.set().

§Examples
letcontext =&mutContext::default();letarray_buffer8 = JsArrayBuffer::new(8, context)?;letinitialized8_array = JsUint8Array::from_array_buffer(array_buffer8, context)?;initialized8_array.set_values(  JsArray::from_iter(vec![JsValue::new(1), JsValue::new(2)], context).into(),Some(3),  context,)?;assert_eq!(initialized8_array.get(0, context)?, JsValue::new(0));assert_eq!(initialized8_array.get(1, context)?, JsValue::new(0));assert_eq!(initialized8_array.get(2, context)?, JsValue::new(0));assert_eq!(initialized8_array.get(3, context)?, JsValue::new(1.0));assert_eq!(initialized8_array.get(4, context)?, JsValue::new(2.0));assert_eq!(initialized8_array.get(5, context)?, JsValue::new(0));assert_eq!(initialized8_array.get(6, context)?, JsValue::new(0));assert_eq!(initialized8_array.get(7, context)?, JsValue::new(0));assert_eq!(initialized8_array.get(8, context)?, JsValue::undefined());
Source

pub fnslice( &self, start:Option<usize>, end:Option<usize>, context: &mutContext,) ->JsResult<Self>

CallsTypedArray.prototype.slice().

Source

pub fnfind( &self, predicate:JsFunction, this_arg:Option<JsValue>, context: &mutContext,) ->JsResult<JsValue>

CallsTypedArray.prototype.find().

Source

pub fnfind_index( &self, predicate:JsFunction, this_arg:Option<JsValue>, context: &mutContext,) ->JsResult<Option<u64>>

Returns the index of the first element in an array that satisfies theprovided testing function.If no elements satisfy the testing function,JsResult::Ok(None) is returned.

CallsTypedArray.prototype.findIndex().

§Examples
letcontext =&mutContext::default();letdata: Vec<u8> = (0..=255).collect();letarray = JsUint8Array::from_iter(data, context)?;letgreter_than_10_predicate = FunctionObjectBuilder::new(    context.realm(),    NativeFunction::from_fn_ptr(|_this, args, _context| {letelement = args            .first()            .cloned()            .unwrap_or_default()            .as_number()            .expect("error at number conversion");Ok(JsValue::from(element >10.0))    }),).build();assert_eq!(    array.find_index(greter_than_10_predicate,None, context),Ok(Some(11)));
Source

pub fnfind_last( &self, predicate:JsFunction, this_arg:Option<JsValue>, context: &mutContext,) ->JsResult<JsValue>

Iterates the typed array in reverse order and returns the value ofthe first element that satisfies the provided testing function.If no elements satisfy the testing function,JsResult::Ok(None) is returned.

CallsTypedArray.prototype.findLast().

§Examples
letcontext =&mutContext::default();letdata: Vec<u8> = (0..=255).collect();letarray = JsUint8Array::from_iter(data, context)?;letlower_than_200_predicate = FunctionObjectBuilder::new(    context.realm(),    NativeFunction::from_fn_ptr(|_this, args, _context| {letelement = args            .first()            .cloned()            .unwrap_or_default()            .as_number()            .expect("error at number conversion");Ok(JsValue::from(element <200.0))    }),).build();assert_eq!(    array.find_last(lower_than_200_predicate.clone(),None, context),Ok(JsValue::new(199)));
Source

pub fnfind_last_index( &self, predicate:JsFunction, this_arg:Option<JsValue>, context: &mutContext,) ->JsResult<Option<u64>>

Iterates the typed array in reverse order and returns the index ofthe first element that satisfies the provided testing function.If no elements satisfy the testing function,JsResult::OK(None) is returned.

CallsTypedArray.prototype.findLastIndex().

§Examples
letcontext =&mutContext::default();letdata: Vec<u8> = (0..=255).collect();letarray = JsUint8Array::from_iter(data, context)?;letlower_than_200_predicate = FunctionObjectBuilder::new(    context.realm(),    NativeFunction::from_fn_ptr(|_this, args, _context| {letelement = args            .first()            .cloned()            .unwrap_or_default()            .as_number()            .expect("error at number conversion");Ok(JsValue::from(element <200.0))    }),).build();assert_eq!(    array.find_last(lower_than_200_predicate.clone(),None, context),Ok(JsValue::new(199)));
Source

pub fnfor_each( &self, callback:JsFunction, this_arg:Option<JsValue>, context: &mutContext,) ->JsResult<JsValue>

Executes a provided function once for each typed array element.

CallsTypedArray.prototype.forEach().

§Examples
letcontext =&mutContext::default();letarray = JsUint8Array::from_iter(vec![1,2,3,4,5], context)?;letnum_to_modify = Gc::new(GcRefCell::new(0u8));letjs_function = FunctionObjectBuilder::new(    context.realm(),    NativeFunction::from_copy_closure_with_captures(        |_, args, captures, inner_context| {letelement = args                .first()                .cloned()                .unwrap_or_default()                .to_uint8(inner_context)                .expect("error at number conversion");*captures.borrow_mut() += element;Ok(JsValue::undefined())        },        Gc::clone(&num_to_modify),    ),).build();array.for_each(js_function,None, context);letborrow =*num_to_modify.borrow();assert_eq!(borrow,15u8);
Source

pub fnincludes<T>( &self, search_element: T, from_index:Option<u64>, context: &mutContext,) ->JsResult<bool>
where T:Into<JsValue>,

Determines whether a typed array includes a certain value among its entries,returning true or false as appropriate.

CallsTypedArray.prototype.includes().

§Examples
letcontext =&mutContext::default();letdata: Vec<u8> = (0..=255).collect();letarray = JsUint8Array::from_iter(data, context)?;assert_eq!(array.includes(JsValue::new(2),None, context),Ok(true));letempty_array = JsUint8Array::from_iter(vec![], context)?;assert_eq!(    empty_array.includes(JsValue::new(2),None, context),Ok(false));
Source

pub fnindex_of<T>( &self, search_element: T, from_index:Option<usize>, context: &mutContext,) ->JsResult<Option<usize>>
where T:Into<JsValue>,

CallsTypedArray.prototype.indexOf().

Source

pub fnlast_index_of<T>( &self, search_element: T, from_index:Option<usize>, context: &mutContext,) ->JsResult<Option<usize>>
where T:Into<JsValue>,

CallsTypedArray.prototype.lastIndexOf().

Source

pub fnjoin( &self, separator:Option<JsString>, context: &mutContext,) ->JsResult<JsString>

CallsTypedArray.prototype.join().

Source

pub fnto_reversed(&self, context: &mutContext) ->JsResult<Self>

CallsTypedArray.prototype.toReversed ( ).

Source

pub fnto_sorted( &self, compare_fn:Option<JsFunction>, context: &mutContext,) ->JsResult<Self>

CallsTypedArray.prototype.toSorted ( comparefn ).

Source

pub fnwith( &self, index:u64, value:JsValue, context: &mutContext,) ->JsResult<Self>

CallsTypedArray.prototype.with ( index, value ).

Source

pub fnto_string_tag(&self, context: &mutContext) ->JsResult<JsValue>

It is a getter that returns the same string as the typed array constructor’s name.It returnsOk(JsValue::Undefined) if the this value is not one of the typed array subclasses.

ReturnsTypedArray.prototype.toStringTag().

§Examples
letcontext =&mutContext::default();letarray = JsUint8Array::from_iter(vec![1u8,2u8,3u8,4u8,5u8,6u8,7u8,8u8], context)?;lettag = array.to_string_tag(context)?.to_string(context)?;assert_eq!(tag,js_string!("Uint8Array"));

Methods fromDeref<Target =JsObject>§

Source

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.

Source

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.

Source

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.

Source

pub fnis_ordinary(&self) ->bool

Checks if it’s an ordinary object.

§Panics

Panics if the object is currently mutably borrowed.

Source

pub fnis_array(&self) ->bool

Checks if it’s anArray object.

Source

pub fnto_property_descriptor( &self, context: &mutContext,) ->JsResult<PropertyDescriptor>

The abstract operationToPropertyDescriptor.

More information:

Source

pub fncopy_data_properties<K>( &self, source: &JsValue, excluded_keys:Vec<K>, context: &mutContext,) ->JsResult<()>
where K:Into<PropertyKey>,

7.3.25 CopyDataProperties ( target, source, excludedItems )

More information:

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fnprototype(&self) ->JsPrototype

Get the prototype of the object.

§Panics

Panics if the object is currently mutably borrowed.

Source

pub fnset_prototype(&self, prototype:JsPrototype) ->bool

Set the prototype of the object.

§Panics

Panics if the object is currently mutably borrowed

Source

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.

Source

pub fnis_callable(&self) ->bool

It determines if Object is a callable function with a[[Call]] internal method.

More information:

Source

pub fnis_constructor(&self) ->bool

It determines if Object is a function object with a[[Construct]] internal method.

More information:

Source

pub fnis_extensible(&self, context: &mutContext) ->JsResult<bool>

Check if object is extensible.

More information:

Source

pub fnget<K>(&self, key: K, context: &mutContext) ->JsResult<JsValue>
where K:Into<PropertyKey>,

Get property from object or throw.

More information:

Source

pub fnset<K, V>( &self, key: K, value: V, throw:bool, context: &mutContext,) ->JsResult<bool>

set property of object or throw if bool flag is passed.

More information:

Source

pub fncreate_data_property<K, V>( &self, key: K, value: V, context: &mutContext,) ->JsResult<bool>

Create data property

More information:

Source

pub fncreate_data_property_or_throw<K, V>( &self, key: K, value: V, context: &mutContext,) ->JsResult<bool>

Create data property or throw

More information:

Source

pub fndefine_property_or_throw<K, P>( &self, key: K, desc: P, context: &mutContext,) ->JsResult<bool>

Define property or throw.

More information:

Source

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:

Source

pub fnhas_property<K>(&self, key: K, context: &mutContext) ->JsResult<bool>
where K:Into<PropertyKey>,

Check if object has property.

More information:

Source

pub fnhas_own_property<K>( &self, key: K, context: &mutContext,) ->JsResult<bool>
where K:Into<PropertyKey>,

Check if object has an own property.

More information:

Source

pub fnown_property_keys( &self, context: &mutContext,) ->JsResult<Vec<PropertyKey>>

Get all the keys of the properties of this object.

More information:

Source

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:

Source

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:

Source

pub fnset_integrity_level( &self, level:IntegrityLevel, context: &mutContext,) ->JsResult<bool>

Make the objectsealed orfrozen.

More information:

Source

pub fntest_integrity_level( &self, level:IntegrityLevel, context: &mutContext,) ->JsResult<bool>

Check if the object issealed orfrozen.

More information:

Trait Implementations§

Source§

implClone forJsInt8Array

Source§

fnclone(&self) ->JsInt8Array

Returns a duplicate of the value.Read more
1.0.0 ·Source§

fnclone_from(&mut self, source: &Self)

Performs copy-assignment fromsource.Read more
Source§

implDebug forJsInt8Array

Source§

fnfmt(&self, f: &mutFormatter<'_>) ->Result

Formats the value using the given formatter.Read more
Source§

implDeref forJsInt8Array

Source§

typeTarget =JsTypedArray

The resulting type after dereferencing.
Source§

fnderef(&self) -> &Self::Target

Dereferences the value.
Source§

implDrop forJsInt8Array

Source§

fndrop(&mut self)

Executes the destructor for this type.Read more
Source§

implFinalize forJsInt8Array

Source§

fnfinalize(&self)

Cleanup logic for a type.
Source§

implFrom<JsInt8Array> forJsObject

Source§

fnfrom(o:JsInt8Array) -> Self

Converts to this type from the input type.
Source§

implFrom<JsInt8Array> forJsValue

Source§

fnfrom(o:JsInt8Array) -> Self

Converts to this type from the input type.
Source§

implTrace forJsInt8Array

Source§

unsafe fntrace(&self, tracer: &mut Tracer)

Marks all containedGcs.Read more
Source§

unsafe fntrace_non_roots(&self)

Trace handles located in GC heap, and mark them as non root.Read more
Source§

fnrun_finalizer(&self)

RunsFinalize::finalize on this object and allcontained subobjects.
Source§

implTryFromJs forJsInt8Array

Source§

fntry_from_js(value: &JsValue, _context: &mutContext) ->JsResult<Self>

This function tries to convert a JavaScript value intoSelf.
Source§

implTryIntoJs forJsInt8Array

Source§

fntry_into_js(&self, _context: &mutContext) ->JsResult<JsValue>

This function tries to convert aSelf intoJsValue.

Auto Trait Implementations§

§

implFreeze forJsInt8Array

§

impl !RefUnwindSafe forJsInt8Array

§

impl !Send forJsInt8Array

§

impl !Sync forJsInt8Array

§

implUnpin forJsInt8Array

§

impl !UnwindSafe forJsInt8Array

Blanket Implementations§

Source§

impl<T>Any for T
where T: 'static + ?Sized,

Source§

fntype_id(&self) ->TypeId

Gets theTypeId ofself.Read more
Source§

impl<T>Borrow<T> for T
where T: ?Sized,

Source§

fnborrow(&self) ->&T

Immutably borrows from an owned value.Read more
Source§

impl<T>BorrowMut<T> for T
where T: ?Sized,

Source§

fnborrow_mut(&mut self) ->&mut T

Mutably borrows from an owned value.Read more
Source§

impl<T>CloneToUninit for T
where T:Clone,

Source§

unsafe fnclone_to_uninit(&self, dest:*mutu8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment fromself todest.Read more
Source§

impl<T>Conv for T

Source§

fnconv<T>(self) -> T
where Self:Into<T>,

Convertsself intoT usingInto<T>.Read more
Source§

impl<T>From<T> for T

Source§

fnfrom(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U>Into<U> for T
where U:From<T>,

Source§

fninto(self) -> U

CallsU::from(self).

That is, this conversion is whatever the implementation ofFrom<T> for U chooses to do.

Source§

impl<T>IntoEither for T

Source§

fninto_either(self, into_left:bool) ->Either<Self, Self>

Convertsself into aLeft variant ofEither<Self, Self>ifinto_left istrue.Convertsself into aRight variant ofEither<Self, Self>otherwise.Read more
Source§

fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>
where F:FnOnce(&Self) ->bool,

Convertsself into aLeft variant ofEither<Self, Self>ifinto_left(&self) returnstrue.Convertsself into aRight variant ofEither<Self, Self>otherwise.Read more
Source§

impl<T>Pipe for T
where T: ?Sized,

Source§

fnpipe<R>(self, func: implFnOnce(Self) -> R) -> R
where Self:Sized,

Pipes by value. This is generally the method you want to use.Read more
Source§

fnpipe_ref<'a, R>(&'a self, func: implFnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrowsself and passes that borrow into the pipe function.Read more
Source§

fnpipe_ref_mut<'a, R>(&'a mut self, func: implFnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrowsself and passes that borrow into the pipe function.Read more
Source§

fnpipe_borrow<'a, B, R>(&'a self, func: implFnOnce(&'a B) -> R) -> R
where Self:Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrowsself, then passesself.borrow() into the pipe function.Read more
Source§

fnpipe_borrow_mut<'a, B, R>( &'a mut self, func: implFnOnce(&'a mut B) -> R,) -> R
where Self:BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrowsself, then passesself.borrow_mut() into the pipefunction.Read more
Source§

fnpipe_as_ref<'a, U, R>(&'a self, func: implFnOnce(&'a U) -> R) -> R
where Self:AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrowsself, 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
where Self:AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrowsself, then passesself.as_mut() into the pipefunction.
Source§

fnpipe_deref<'a, T, R>(&'a self, func: implFnOnce(&'a T) -> R) -> R
where Self:Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrowsself, then passesself.deref() into the pipe function.
Source§

fnpipe_deref_mut<'a, T, R>( &'a mut self, func: implFnOnce(&'a mut T) -> R,) -> R
where Self:DerefMut<Target = T> +Deref, T: 'a + ?Sized, R: 'a,

Mutably borrowsself, then passesself.deref_mut() into the pipefunction.
Source§

impl<P, T>Receiver for P
where P:Deref<Target = T> + ?Sized, T: ?Sized,

Source§

typeTarget = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T>Tap for T

Source§

fntap(self, func: implFnOnce(&Self)) -> Self

Immutable access to a value.Read more
Source§

fntap_mut(self, func: implFnOnce(&mut Self)) -> Self

Mutable access to a value.Read more
Source§

fntap_borrow<B>(self, func: implFnOnce(&B)) -> Self
where Self:Borrow<B>, B: ?Sized,

Immutable access to theBorrow<B> of a value.Read more
Source§

fntap_borrow_mut<B>(self, func: implFnOnce(&mut B)) -> Self
where Self:BorrowMut<B>, B: ?Sized,

Mutable access to theBorrowMut<B> of a value.Read more
Source§

fntap_ref<R>(self, func: implFnOnce(&R)) -> Self
where Self:AsRef<R>, R: ?Sized,

Immutable access to theAsRef<R> view of a value.Read more
Source§

fntap_ref_mut<R>(self, func: implFnOnce(&mut R)) -> Self
where Self:AsMut<R>, R: ?Sized,

Mutable access to theAsMut<R> view of a value.Read more
Source§

fntap_deref<T>(self, func: implFnOnce(&T)) -> Self
where Self:Deref<Target = T>, T: ?Sized,

Immutable access to theDeref::Target of a value.Read more
Source§

fntap_deref_mut<T>(self, func: implFnOnce(&mut T)) -> Self
where Self:DerefMut<Target = T> +Deref, T: ?Sized,

Mutable access to theDeref::Target of a value.Read more
Source§

fntap_dbg(self, func: implFnOnce(&Self)) -> Self

Calls.tap() only in debug builds, and is erased in release builds.
Source§

fntap_mut_dbg(self, func: implFnOnce(&mut Self)) -> Self

Calls.tap_mut() only in debug builds, and is erased in releasebuilds.
Source§

fntap_borrow_dbg<B>(self, func: implFnOnce(&B)) -> Self
where Self:Borrow<B>, B: ?Sized,

Calls.tap_borrow() only in debug builds, and is erased in releasebuilds.
Source§

fntap_borrow_mut_dbg<B>(self, func: implFnOnce(&mut B)) -> Self
where Self:BorrowMut<B>, B: ?Sized,

Calls.tap_borrow_mut() only in debug builds, and is erased in releasebuilds.
Source§

fntap_ref_dbg<R>(self, func: implFnOnce(&R)) -> Self
where Self:AsRef<R>, R: ?Sized,

Calls.tap_ref() only in debug builds, and is erased in releasebuilds.
Source§

fntap_ref_mut_dbg<R>(self, func: implFnOnce(&mut R)) -> Self
where Self:AsMut<R>, R: ?Sized,

Calls.tap_ref_mut() only in debug builds, and is erased in releasebuilds.
Source§

fntap_deref_dbg<T>(self, func: implFnOnce(&T)) -> Self
where Self:Deref<Target = T>, T: ?Sized,

Calls.tap_deref() only in debug builds, and is erased in releasebuilds.
Source§

fntap_deref_mut_dbg<T>(self, func: implFnOnce(&mut T)) -> Self
where Self:DerefMut<Target = T> +Deref, T: ?Sized,

Calls.tap_deref_mut() only in debug builds, and is erased in releasebuilds.
Source§

impl<T>ToOwned for T
where T:Clone,

Source§

typeOwned = T

The resulting type after obtaining ownership.
Source§

fnto_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning.Read more
Source§

fnclone_into(&self, target:&mut T)

Uses borrowed data to replace owned data, usually by cloning.Read more
Source§

impl<T>TryConv for T

Source§

fntry_conv<T>(self) ->Result<T, Self::Error>
where Self:TryInto<T>,

Attempts to convertself intoT usingTryInto<T>.Read more
Source§

impl<T, U>TryFrom<U> for T
where U:Into<T>,

Source§

typeError =Infallible

The type returned in the event of a conversion error.
Source§

fntry_from(value: U) ->Result<T, <T asTryFrom<U>>::Error>

Performs the conversion.
Source§

impl<'a, T>TryFromJsArgument<'a> for T
where T:TryFromJs,

Source§

fntry_from_js_argument( _: &'aJsValue, rest: &'a [JsValue], context: &mutContext,) ->Result<(T, &'a [JsValue]),JsError>

Try to convert a JS argument into a Rust value, returning thevalue and the rest of the arguments to be parsed.Read more
Source§

impl<T, U>TryInto<U> for T
where U:TryFrom<T>,

Source§

typeError = <U asTryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fntry_into(self) ->Result<U, <U asTryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T>TryIntoJsResult for T
where T:TryIntoJs,

Source§

fntry_into_js_result(self, ctx: &mutContext) ->Result<JsValue,JsError>

Try to convert a Rust value into aJsResult<JsValue>.Read more
Source§

impl<V, T>VZip<V> for T
where V:MultiLane<T>,

Source§

fnvzip(self) -> V

Source§

impl<T>ErasedDestructor for T
where T: 'static,


[8]ページ先頭

©2009-2025 Movatter.jp