pub struct PropertyDescriptorBuilder { /* private fields */ }Expand description
A builder for PropertyDescriptor.
Implementations§
Source§impl PropertyDescriptorBuilder
impl PropertyDescriptorBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new PropertyDescriptorBuilder.
Sourcepub fn value<V: Into<JsValue>>(self, value: V) -> Self
pub fn value<V: Into<JsValue>>(self, value: V) -> Self
Sets the value field of the property descriptor.
Sourcepub fn writable(self, writable: bool) -> Self
pub fn writable(self, writable: bool) -> Self
Sets the writable field of the property descriptor.
Sourcepub fn get<V: Into<JsValue>>(self, get: V) -> Self
pub fn get<V: Into<JsValue>>(self, get: V) -> Self
Sets the get field of the property descriptor.
Sourcepub fn set<V: Into<JsValue>>(self, set: V) -> Self
pub fn set<V: Into<JsValue>>(self, set: V) -> Self
Sets the set field of the property descriptor.
Sourcepub const fn maybe_enumerable(self, enumerable: Option<bool>) -> Self
pub const fn maybe_enumerable(self, enumerable: Option<bool>) -> Self
Optionally sets the enumerable field of the property descriptor.
Sourcepub const fn maybe_configurable(self, configurable: Option<bool>) -> Self
pub const fn maybe_configurable(self, configurable: Option<bool>) -> Self
Optionally sets the configurable field of the property descriptor.
Sourcepub fn maybe_value<V: Into<JsValue>>(self, value: Option<V>) -> Self
pub fn maybe_value<V: Into<JsValue>>(self, value: Option<V>) -> Self
Optionally sets the value field of the property descriptor.
Sourcepub fn maybe_writable(self, writable: Option<bool>) -> Self
pub fn maybe_writable(self, writable: Option<bool>) -> Self
Optionally sets the writable field of the property descriptor.
Sourcepub fn maybe_get<V: Into<JsValue>>(self, get: Option<V>) -> Self
pub fn maybe_get<V: Into<JsValue>>(self, get: Option<V>) -> Self
Optionally sets the get field of the property descriptor.
Sourcepub fn maybe_set<V: Into<JsValue>>(self, set: Option<V>) -> Self
pub fn maybe_set<V: Into<JsValue>>(self, set: Option<V>) -> Self
Optionally sets the set field of the property descriptor.
Sourcepub const fn enumerable(self, enumerable: bool) -> Self
pub const fn enumerable(self, enumerable: bool) -> Self
Sets the enumerable field of the property descriptor.
Sourcepub const fn configurable(self, configurable: bool) -> Self
pub const fn configurable(self, configurable: bool) -> Self
Sets the configurable field of the property descriptor.
Sourcepub fn complete_with_defaults(self) -> Self
pub fn complete_with_defaults(self) -> Self
Fill any missing fields in the property descriptor.
Sourcepub const fn inner(&self) -> &PropertyDescriptor
pub const fn inner(&self) -> &PropertyDescriptor
Returns a reference to the currently built PropertyDescriptor.
Sourcepub fn build(self) -> PropertyDescriptor
pub fn build(self) -> PropertyDescriptor
Consumes the builder and returns the PropertyDescriptor.
Trait Implementations§
Source§impl Clone for PropertyDescriptorBuilder
impl Clone for PropertyDescriptorBuilder
Source§impl Debug for PropertyDescriptorBuilder
impl Debug for PropertyDescriptorBuilder
Source§impl Default for PropertyDescriptorBuilder
impl Default for PropertyDescriptorBuilder
Source§impl From<PropertyDescriptorBuilder> for PropertyDescriptor
impl From<PropertyDescriptorBuilder> for PropertyDescriptor
Source§fn from(builder: PropertyDescriptorBuilder) -> Self
fn from(builder: PropertyDescriptorBuilder) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for PropertyDescriptorBuilder
impl !Send for PropertyDescriptorBuilder
impl !Sync for PropertyDescriptorBuilder
impl !UnwindSafe for PropertyDescriptorBuilder
impl Freeze for PropertyDescriptorBuilder
impl Unpin for PropertyDescriptorBuilder
impl UnsafeUnpin for PropertyDescriptorBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.