Struct rustjs::deno_core::v8::Function

source ·
#[repr(C)]
pub struct Function(/* private fields */);
Expand description

A JavaScript function object (ECMA-262, 15.3).

Implementations§

source§

impl Function

source

pub fn builder<'s>( callback: impl MapFnTo<extern "C" fn(_: *const FunctionCallbackInfo)>, ) -> FunctionBuilder<'s, Function>

Create a FunctionBuilder to configure a Function. This is the same as FunctionBuilder::::new().

source

pub fn builder_raw<'s>( callback: extern "C" fn(_: *const FunctionCallbackInfo), ) -> FunctionBuilder<'s, Function>

source

pub fn new<'s>( scope: &mut HandleScope<'s>, callback: impl MapFnTo<extern "C" fn(_: *const FunctionCallbackInfo)>, ) -> Option<Local<'s, Function>>

Create a function in the current execution context for a given FunctionCallback.

source

pub fn new_raw<'s>( scope: &mut HandleScope<'s>, callback: extern "C" fn(_: *const FunctionCallbackInfo), ) -> Option<Local<'s, Function>>

source

pub fn call<'s>( &self, scope: &mut HandleScope<'s>, recv: Local<'_, Value>, args: &[Local<'_, Value>], ) -> Option<Local<'s, Value>>

Call a function in a context scope.

source

pub fn call_with_context<'s>( &self, scope: &mut HandleScope<'s, ()>, context: Local<'_, Context>, recv: Local<'_, Value>, args: &[Local<'_, Value>], ) -> Option<Local<'s, Value>>

Call a function in a given context.

source

pub fn new_instance<'s>( &self, scope: &mut HandleScope<'s>, args: &[Local<'_, Value>], ) -> Option<Local<'s, Object>>

source

pub fn get_name<'s>(&self, scope: &mut HandleScope<'s>) -> Local<'s, String>

source

pub fn set_name(&self, name: Local<'_, String>)

source

pub fn get_script_column_number(&self) -> Option<u32>

Get the (zero-indexed) column number of the function’s definition, if available.

source

pub fn get_script_line_number(&self) -> Option<u32>

Get the (zero-indexed) line number of the function’s definition, if available.

source

pub fn get_script_origin(&self) -> &ScriptOrigin<'_>

source

pub fn script_id(&self) -> i32

Returns scriptId.

source

pub fn create_code_cache(&self) -> Option<UniqueRef<CachedData<'static>>>

Creates and returns code cache for the specified unbound_script. This will return nullptr if the script cannot be serialized. The CachedData returned by this function should be owned by the caller.

Methods from Deref<Target = Object>§

source

pub fn set( &self, scope: &mut HandleScope<'_>, key: Local<'_, Value>, value: Local<'_, Value>, ) -> Option<bool>

Set only return Just(true) or Empty(), so if it should never fail, use result.Check().

source

pub fn set_index( &self, scope: &mut HandleScope<'_>, index: u32, value: Local<'_, Value>, ) -> Option<bool>

Set only return Just(true) or Empty(), so if it should never fail, use result.Check().

source

pub fn set_prototype( &self, scope: &mut HandleScope<'_>, prototype: Local<'_, Value>, ) -> Option<bool>

Set the prototype object. This does not skip objects marked to be skipped by proto and it does not consult the security handler.

source

pub fn get_constructor_name(&self) -> Local<'_, String>

Returns the name of the function invoked as a constructor for this object.

source

pub fn create_data_property( &self, scope: &mut HandleScope<'_>, key: Local<'_, Name>, value: Local<'_, Value>, ) -> Option<bool>

Implements CreateDataProperty (ECMA-262, 7.3.4).

Defines a configurable, writable, enumerable property with the given value on the object unless the property already exists and is not configurable or the object is not extensible.

Returns true on success.

source

pub fn define_own_property( &self, scope: &mut HandleScope<'_>, key: Local<'_, Name>, value: Local<'_, Value>, attr: PropertyAttribute, ) -> Option<bool>

Implements DefineOwnProperty.

In general, CreateDataProperty will be faster, however, does not allow for specifying attributes.

Returns true on success.

source

pub fn define_property( &self, scope: &mut HandleScope<'_>, key: Local<'_, Name>, descriptor: &PropertyDescriptor, ) -> Option<bool>

source

pub fn get<'s>( &self, scope: &mut HandleScope<'s>, key: Local<'_, Value>, ) -> Option<Local<'s, Value>>

source

pub fn get_index<'s>( &self, scope: &mut HandleScope<'s>, index: u32, ) -> Option<Local<'s, Value>>

source

pub fn get_prototype<'s>( &self, scope: &mut HandleScope<'s>, ) -> Option<Local<'s, Value>>

Get the prototype object. This does not skip objects marked to be skipped by proto and it does not consult the security handler.

source

pub fn set_accessor( &self, scope: &mut HandleScope<'_>, name: Local<'_, Name>, getter: impl for<'s> MapFnTo<extern "C" fn(_: Local<'s, Name>, _: *const PropertyCallbackInfo)>, ) -> Option<bool>

Note: SideEffectType affects the getter only, not the setter.

source

pub fn set_accessor_with_setter( &self, scope: &mut HandleScope<'_>, name: Local<'_, Name>, getter: impl for<'s> MapFnTo<extern "C" fn(_: Local<'s, Name>, _: *const PropertyCallbackInfo)>, setter: impl for<'s> MapFnTo<extern "C" fn(_: Local<'s, Name>, _: Local<'s, Value>, _: *const PropertyCallbackInfo)>, ) -> Option<bool>

source

pub fn set_accessor_with_configuration( &self, scope: &mut HandleScope<'_>, name: Local<'_, Name>, configuration: AccessorConfiguration<'_>, ) -> Option<bool>

source

pub fn get_identity_hash(&self) -> NonZero<i32>

Returns the V8 hash value for this value. The current implementation uses a hidden property to store the identity hash.

The return value will never be 0. Also, it is not guaranteed to be unique.

source

pub fn get_creation_context<'s>( &self, scope: &mut HandleScope<'s>, ) -> Option<Local<'s, Context>>

Returns the context in which the object was created.

source

pub fn get_own_property_names<'s>( &self, scope: &mut HandleScope<'s>, args: GetPropertyNamesArgs, ) -> Option<Local<'s, Array>>

This function has the same functionality as GetPropertyNames but the returned array doesn’t contain the names of properties from prototype objects.

source

pub fn get_property_names<'s>( &self, scope: &mut HandleScope<'s>, args: GetPropertyNamesArgs, ) -> Option<Local<'s, Array>>

Returns an array containing the names of the filtered properties of this object, including properties from prototype objects. The array returned by this method contains the same values as would be enumerated by a for-in statement over this object.

source

pub fn has( &self, scope: &mut HandleScope<'_>, key: Local<'_, Value>, ) -> Option<bool>

source

pub fn has_index(&self, scope: &mut HandleScope<'_>, index: u32) -> Option<bool>

source

pub fn has_own_property( &self, scope: &mut HandleScope<'_>, key: Local<'_, Name>, ) -> Option<bool>

HasOwnProperty() is like JavaScript’s Object.prototype.hasOwnProperty().

source

pub fn delete( &self, scope: &mut HandleScope<'_>, key: Local<'_, Value>, ) -> Option<bool>

source

pub fn delete_index( &self, scope: &mut HandleScope<'_>, index: u32, ) -> Option<bool>

source

pub fn internal_field_count(&self) -> usize

Gets the number of internal fields for this Object.

source

pub fn get_internal_field<'s>( &self, scope: &mut HandleScope<'s>, index: usize, ) -> Option<Local<'s, Data>>

Gets the data from an internal field.

source

pub unsafe fn get_aligned_pointer_from_internal_field( &self, index: i32, ) -> *const c_void

Gets a 2-byte-aligned native pointer from an internal field.

§Safety

This field must have been set by SetAlignedPointerInInternalField, everything else leads to undefined behavior.

source

pub fn set_aligned_pointer_in_internal_field( &self, index: i32, value: *const c_void, )

Sets a 2-byte-aligned native pointer in an internal field. To retrieve such a field, GetAlignedPointerFromInternalField must be used.

source

pub fn set_integrity_level( &self, scope: &mut HandleScope<'_>, level: IntegrityLevel, ) -> Option<bool>

Sets the integrity level of the object.

source

pub fn set_internal_field(&self, index: usize, data: Local<'_, Data>) -> bool

Sets the data in an internal field. Returns false when the index is out of bounds, true otherwise.

source

pub fn get_private<'s>( &self, scope: &mut HandleScope<'s>, key: Local<'_, Private>, ) -> Option<Local<'s, Value>>

Functionality for private properties. This is an experimental feature, use at your own risk. Note: Private properties are not inherited. Do not rely on this, since it may change.

source

pub fn set_private( &self, scope: &mut HandleScope<'_>, key: Local<'_, Private>, value: Local<'_, Value>, ) -> Option<bool>

Functionality for private properties. This is an experimental feature, use at your own risk. Note: Private properties are not inherited. Do not rely on this, since it may change.

source

pub fn delete_private( &self, scope: &mut HandleScope<'_>, key: Local<'_, Private>, ) -> Option<bool>

Functionality for private properties. This is an experimental feature, use at your own risk. Note: Private properties are not inherited. Do not rely on this, since it may change.

source

pub fn has_private( &self, scope: &mut HandleScope<'_>, key: Local<'_, Private>, ) -> Option<bool>

Functionality for private properties. This is an experimental feature, use at your own risk. Note: Private properties are not inherited. Do not rely on this, since it may change.

source

pub fn get_property_attributes( &self, scope: &mut HandleScope<'_>, key: Local<'_, Value>, ) -> Option<PropertyAttribute>

Gets the property attributes of a property which can be PropertyAttribute::NONE or any combination of PropertyAttribute::READ_ONLY, PropertyAttribute::DONT_ENUM and PropertyAttribute::DONT_DELETE. Returns PropertyAttribute::NONE when the property doesn’t exist.

source

pub fn get_own_property_descriptor<'s>( &self, scope: &mut HandleScope<'s>, key: Local<'_, Name>, ) -> Option<Local<'s, Value>>

Implements Object.getOwnPropertyDescriptor(O, P), see https://tc39.es/ecma262/#sec-object.getownpropertydescriptor.

source

pub fn preview_entries<'s>( &self, scope: &mut HandleScope<'s>, ) -> (Option<Local<'s, Array>>, bool)

If this object is a Set, Map, WeakSet or WeakMap, this returns a representation of the elements of this object as an array. If this object is a SetIterator or MapIterator, this returns all elements of the underlying collection, starting at the iterator’s current position.

Also returns a boolean, indicating whether the returned array contains key & values (for example when the value is Set.entries()).

source

pub fn get_real_named_property<'s>( &self, scope: &mut HandleScope<'s>, key: Local<'_, Name>, ) -> Option<Local<'s, Value>>

If result.IsEmpty() no real property was located on the object or in the prototype chain. This means interceptors in the prototype chain are not called.

source

pub fn get_real_named_property_attributes( &self, scope: &mut HandleScope<'_>, key: Local<'_, Name>, ) -> Option<PropertyAttribute>

Gets the property attributes of a real property which can be None or any combination of ReadOnly, DontEnum and DontDelete. Interceptors in the prototype chain are not called.

Methods from Deref<Target = Value>§

source

pub fn is_undefined(&self) -> bool

Returns true if this value is the undefined value. See ECMA-262 4.3.10.

source

pub fn is_null(&self) -> bool

Returns true if this value is the null value. See ECMA-262 4.3.11.

source

pub fn is_null_or_undefined(&self) -> bool

Returns true if this value is either the null or the undefined value. See ECMA-262 4.3.11. and 4.3.12

source

pub fn is_true(&self) -> bool

Returns true if this value is true. This is not the same as BooleanValue(). The latter performs a conversion to boolean, i.e. the result of Boolean(value) in JS, whereas this checks value === true.

source

pub fn is_false(&self) -> bool

Returns true if this value is false. This is not the same as !BooleanValue(). The latter performs a conversion to boolean, i.e. the result of !Boolean(value) in JS, whereas this checks value === false.

source

pub fn is_name(&self) -> bool

Returns true if this value is a symbol or a string. This is equivalent to typeof value === 'string' || typeof value === 'symbol' in JS.

source

pub fn is_string(&self) -> bool

Returns true if this value is an instance of the String type. See ECMA-262 8.4.

source

pub fn is_symbol(&self) -> bool

Returns true if this value is a symbol. This is equivalent to typeof value === 'symbol' in JS.

source

pub fn is_function(&self) -> bool

Returns true if this value is a function.

source

pub fn is_array(&self) -> bool

Returns true if this value is an array. Note that it will return false for an Proxy for an array.

source

pub fn is_object(&self) -> bool

Returns true if this value is an object.

source

pub fn is_big_int(&self) -> bool

Returns true if this value is a bigint. This is equivalent to typeof value === 'bigint' in JS.

source

pub fn is_boolean(&self) -> bool

Returns true if this value is boolean. This is equivalent to typeof value === 'boolean' in JS.

source

pub fn is_number(&self) -> bool

Returns true if this value is a number.

source

pub fn is_external(&self) -> bool

Returns true if this value is an External object.

source

pub fn is_int32(&self) -> bool

Returns true if this value is a 32-bit signed integer.

source

pub fn is_uint32(&self) -> bool

Returns true if this value is a 32-bit unsigned integer.

source

pub fn is_date(&self) -> bool

Returns true if this value is a Date.

source

pub fn is_arguments_object(&self) -> bool

Returns true if this value is an Arguments object.

source

pub fn is_big_int_object(&self) -> bool

Returns true if this value is a BigInt object.

source

pub fn is_boolean_object(&self) -> bool

Returns true if this value is a Boolean object.

source

pub fn is_number_object(&self) -> bool

Returns true if this value is a Number object.

source

pub fn is_string_object(&self) -> bool

Returns true if this value is a String object.

source

pub fn is_symbol_object(&self) -> bool

Returns true if this value is a Symbol object.

source

pub fn is_native_error(&self) -> bool

Returns true if this value is a NativeError.

source

pub fn is_reg_exp(&self) -> bool

Returns true if this value is a RegExp.

source

pub fn is_async_function(&self) -> bool

Returns true if this value is an async function.

source

pub fn is_generator_function(&self) -> bool

Returns true if this value is a Generator function.

source

pub fn is_promise(&self) -> bool

Returns true if this value is a Promise.

source

pub fn is_map(&self) -> bool

Returns true if this value is a Map.

source

pub fn is_set(&self) -> bool

Returns true if this value is a Set.

source

pub fn is_map_iterator(&self) -> bool

Returns true if this value is a Map Iterator.

source

pub fn is_set_iterator(&self) -> bool

Returns true if this value is a Set Iterator.

source

pub fn is_generator_object(&self) -> bool

Returns true if this value is a Generator Object.

source

pub fn is_weak_map(&self) -> bool

Returns true if this value is a WeakMap.

source

pub fn is_weak_set(&self) -> bool

Returns true if this value is a WeakSet.

source

pub fn is_array_buffer(&self) -> bool

Returns true if this value is an ArrayBuffer.

source

pub fn is_array_buffer_view(&self) -> bool

Returns true if this value is an ArrayBufferView.

source

pub fn is_typed_array(&self) -> bool

Returns true if this value is one of TypedArrays.

source

pub fn is_uint8_array(&self) -> bool

Returns true if this value is an Uint8Array.

source

pub fn is_uint8_clamped_array(&self) -> bool

Returns true if this value is an Uint8ClampedArray.

source

pub fn is_int8_array(&self) -> bool

Returns true if this value is an Int8Array.

source

pub fn is_uint16_array(&self) -> bool

Returns true if this value is an Uint16Array.

source

pub fn is_int16_array(&self) -> bool

Returns true if this value is an Int16Array.

source

pub fn is_uint32_array(&self) -> bool

Returns true if this value is an Uint32Array.

source

pub fn is_int32_array(&self) -> bool

Returns true if this value is an Int32Array.

source

pub fn is_float32_array(&self) -> bool

Returns true if this value is a Float32Array.

source

pub fn is_float64_array(&self) -> bool

Returns true if this value is a Float64Array.

source

pub fn is_big_int64_array(&self) -> bool

Returns true if this value is a BigInt64Array.

source

pub fn is_big_uint64_array(&self) -> bool

Returns true if this value is a BigUint64Array.

source

pub fn is_data_view(&self) -> bool

Returns true if this value is a DataView.

source

pub fn is_shared_array_buffer(&self) -> bool

Returns true if this value is a SharedArrayBuffer. This is an experimental feature.

source

pub fn is_proxy(&self) -> bool

Returns true if this value is a JavaScript Proxy.

source

pub fn is_wasm_memory_object(&self) -> bool

Returns true if this value is a WasmMemoryObject.

source

pub fn is_wasm_module_object(&self) -> bool

Returns true if this value is a WasmModuleObject.

source

pub fn is_module_namespace_object(&self) -> bool

Returns true if the value is a Module Namespace Object.

source

pub fn strict_equals(&self, that: Local<'_, Value>) -> bool

source

pub fn same_value(&self, that: Local<'_, Value>) -> bool

source

pub fn same_value_zero(&self, that: Local<'_, Value>) -> bool

Implements the the abstract operation SameValueZero, which is defined in ECMA-262 6th edition § 7.2.10 (http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero).

This operation is used to compare values for the purpose of insertion into a Set, or determining whether Map keys are equivalent. Its semantics are almost the same as strict_equals() and same_value(), with the following important distinctions:

  • It considers NaN equal to NaN (unlike strict_equals()).
  • It considers -0 equal to 0 (unlike same_value()).
source

pub fn to_big_int<'s>( &self, scope: &mut HandleScope<'s>, ) -> Option<Local<'s, BigInt>>

source

pub fn to_number<'s>( &self, scope: &mut HandleScope<'s>, ) -> Option<Local<'s, Number>>

source

pub fn to_string<'s>( &self, scope: &mut HandleScope<'s>, ) -> Option<Local<'s, String>>

source

pub fn to_rust_string_lossy(&self, scope: &mut HandleScope<'_>) -> String

Convenience function not present in the original V8 API.

source

pub fn to_detail_string<'s>( &self, scope: &mut HandleScope<'s>, ) -> Option<Local<'s, String>>

source

pub fn to_object<'s>( &self, scope: &mut HandleScope<'s>, ) -> Option<Local<'s, Object>>

source

pub fn to_integer<'s>( &self, scope: &mut HandleScope<'s>, ) -> Option<Local<'s, Integer>>

source

pub fn to_uint32<'s>( &self, scope: &mut HandleScope<'s>, ) -> Option<Local<'s, Uint32>>

source

pub fn to_int32<'s>( &self, scope: &mut HandleScope<'s>, ) -> Option<Local<'s, Int32>>

source

pub fn to_boolean<'s>( &self, scope: &mut HandleScope<'s, ()>, ) -> Local<'s, Boolean>

Perform the equivalent of Boolean(value) in JS. This can never fail.

source

pub fn instance_of( &self, scope: &mut HandleScope<'_>, object: Local<'_, Object>, ) -> Option<bool>

source

pub fn number_value(&self, scope: &mut HandleScope<'_>) -> Option<f64>

source

pub fn integer_value(&self, scope: &mut HandleScope<'_>) -> Option<i64>

source

pub fn uint32_value(&self, scope: &mut HandleScope<'_>) -> Option<u32>

source

pub fn int32_value(&self, scope: &mut HandleScope<'_>) -> Option<i32>

source

pub fn boolean_value(&self, scope: &mut HandleScope<'_, ()>) -> bool

source

pub fn get_hash(&self) -> NonZero<i32>

Returns the V8 hash value for this value. The current implementation uses a hidden property to store the identity hash on some object types.

The return value will never be 0. Also, it is not guaranteed to be unique.

source

pub fn type_of<'s>(&self, scope: &mut HandleScope<'s, ()>) -> Local<'s, String>

source

pub fn type_repr(&self) -> &'static str

Utility method that returns human readable representation of the underlying value.

Methods from Deref<Target = Data>§

source

pub fn is_big_int(&self) -> bool

Returns true if this data is a BigInt.

source

pub fn is_boolean(&self) -> bool

Returns true if this data is a Boolean.

source

pub fn is_context(&self) -> bool

Returns true if this data is a Context.

source

pub fn is_fixed_array(&self) -> bool

Returns true if this data is a FixedArray.

source

pub fn is_function_template(&self) -> bool

Returns true if this data is a FunctionTemplate.

source

pub fn is_module(&self) -> bool

Returns true if this data is a Module.

source

pub fn is_module_request(&self) -> bool

Returns true if this data is a ModuleRequest.

source

pub fn is_name(&self) -> bool

Returns true if this data is a Name.

source

pub fn is_number(&self) -> bool

Returns true if this data is a Number.

source

pub fn is_object_template(&self) -> bool

Returns true if this data is a ObjectTemplate.

source

pub fn is_primitive(&self) -> bool

Returns true if this data is a Primitive.

source

pub fn is_private(&self) -> bool

Returns true if this data is a Private.

source

pub fn is_string(&self) -> bool

Returns true if this data is a String.

source

pub fn is_symbol(&self) -> bool

Returns true if this data is a Symbol.

source

pub fn is_value(&self) -> bool

Returns true if this data is a Value.

Trait Implementations§

source§

impl Debug for Function

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

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

impl Deref for Function

§

type Target = Object

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Function as Deref>::Target

Dereferences the value.
source§

impl Hash for Function

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'s> PartialEq<Data> for Function

source§

fn eq(&self, other: &Data) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'s> PartialEq<Function> for Data

source§

fn eq(&self, other: &Function) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'s> PartialEq<Function> for Object

source§

fn eq(&self, other: &Function) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'s> PartialEq<Function> for Value

source§

fn eq(&self, other: &Function) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'s> PartialEq<Object> for Function

source§

fn eq(&self, other: &Object) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'s> PartialEq<Value> for Function

source§

fn eq(&self, other: &Value) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'s> PartialEq for Function

source§

fn eq(&self, other: &Function) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Function

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Conv for T

source§

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

Converts self into T using Into<T>. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> FmtForward for T

source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> IntoEither for T

source§

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

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

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

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
source§

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

Mutably borrows self, then passes self.deref_mut() into the pipe function.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> Tap for T

source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

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

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
source§

impl<T> TryConv for T

source§

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

Attempts to convert self into T using TryInto<T>. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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

source§

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

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSync for T
where T: Sync,