Skip to content

Commit

Permalink
feat: Add IndexedPropertyHandlerConfiguration::*_raw methods (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored Mar 13, 2024
1 parent 2371c45 commit b830671
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,14 @@ impl<'s> IndexedPropertyHandlerConfiguration<'s> {
self
}

pub fn getter_raw(
mut self,
getter: IndexedPropertyGetterCallback<'s>,
) -> Self {
self.getter = Some(getter);
self
}

pub fn setter(
mut self,
setter: impl MapFnTo<IndexedPropertySetterCallback<'s>>,
Expand All @@ -508,6 +516,14 @@ impl<'s> IndexedPropertyHandlerConfiguration<'s> {
self
}

pub fn setter_raw(
mut self,
setter: IndexedPropertySetterCallback<'s>,
) -> Self {
self.setter = Some(setter);
self
}

pub fn query(
mut self,
query: impl MapFnTo<IndexedPropertyQueryCallback<'s>>,
Expand All @@ -516,6 +532,11 @@ impl<'s> IndexedPropertyHandlerConfiguration<'s> {
self
}

pub fn query_raw(mut self, query: IndexedPropertyQueryCallback<'s>) -> Self {
self.query = Some(query);
self
}

pub fn deleter(
mut self,
deleter: impl MapFnTo<IndexedPropertyDeleterCallback<'s>>,
Expand All @@ -524,6 +545,14 @@ impl<'s> IndexedPropertyHandlerConfiguration<'s> {
self
}

pub fn deleter_raw(
mut self,
deleter: IndexedPropertyDeleterCallback<'s>,
) -> Self {
self.deleter = Some(deleter);
self
}

pub fn enumerator(
mut self,
enumerator: impl MapFnTo<IndexedPropertyEnumeratorCallback<'s>>,
Expand All @@ -532,6 +561,14 @@ impl<'s> IndexedPropertyHandlerConfiguration<'s> {
self
}

pub fn enumerator_raw(
mut self,
enumerator: IndexedPropertyEnumeratorCallback<'s>,
) -> Self {
self.enumerator = Some(enumerator);
self
}

pub fn definer(
mut self,
definer: impl MapFnTo<IndexedPropertyDefinerCallback<'s>>,
Expand All @@ -540,6 +577,14 @@ impl<'s> IndexedPropertyHandlerConfiguration<'s> {
self
}

pub fn definer_raw(
mut self,
definer: IndexedPropertyDefinerCallback<'s>,
) -> Self {
self.definer = Some(definer);
self
}

pub fn descriptor(
mut self,
descriptor: impl MapFnTo<IndexedPropertyDescriptorCallback<'s>>,
Expand All @@ -548,6 +593,14 @@ impl<'s> IndexedPropertyHandlerConfiguration<'s> {
self
}

pub fn descriptor_raw(
mut self,
descriptor: IndexedPropertyDescriptorCallback<'s>,
) -> Self {
self.descriptor = Some(descriptor);
self
}

/// Set the associated data. The default is no associated data.
pub fn data(mut self, data: Local<'s, Value>) -> Self {
self.data = Some(data);
Expand Down

0 comments on commit b830671

Please sign in to comment.