pub struct NonEmptyObject(/* private fields */);Expand description
Non-empty JSON object.
Implementations§
Source§impl NonEmptyObject
impl NonEmptyObject
pub fn try_from_object(object: Object) -> Result<Self, EmptyObject>
pub fn as_object(&self) -> &Object
pub fn into_object(self) -> Object
pub fn iter_mut(&mut self) -> IterMut<'_>
Sourcepub fn get_mut<Q>(&mut self, key: &Q) -> ValuesMut<'_>
pub fn get_mut<Q>(&mut self, key: &Q) -> ValuesMut<'_>
Returns an iterator over the values matching the given key.
Runs in O(1) (average).
Sourcepub fn get_unique_mut<Q>(
&mut self,
key: &Q,
) -> Result<Option<&mut Value>, Duplicate<&Entry>>
pub fn get_unique_mut<Q>( &mut self, key: &Q, ) -> Result<Option<&mut Value>, Duplicate<&Entry>>
Returns the unique entry value matching the given key.
Returns an error if multiple entries match the key.
Runs in O(1) (average).
Sourcepub fn get_or_insert_with<Q>(
&mut self,
key: &Q,
f: impl FnOnce() -> Value,
) -> &Value
pub fn get_or_insert_with<Q>( &mut self, key: &Q, f: impl FnOnce() -> Value, ) -> &Value
Returns the (first) value associated to key, or insert a key-value
entry where value is returned by the given function f.
Sourcepub fn get_mut_or_insert_with<Q>(
&mut self,
key: &Q,
f: impl FnOnce() -> Value,
) -> &mut Value
pub fn get_mut_or_insert_with<Q>( &mut self, key: &Q, f: impl FnOnce() -> Value, ) -> &mut Value
Returns a mutable reference to the (first) value associated to key, or
insert a key-value entry where value is returned by the given
function f.
Sourcepub fn push(&mut self, key: Key, value: Value) -> bool
pub fn push(&mut self, key: Key, value: Value) -> bool
Push the given key-value pair to the end of the object.
Returns true if the key was not already present in the object,
and false otherwise.
Any previous entry matching the key is not overridden: duplicates
are preserved, in order.
Runs in O(1).
pub fn push_entry(&mut self, entry: Entry) -> bool
Sourcepub fn push_front(&mut self, key: Key, value: Value) -> bool
pub fn push_front(&mut self, key: Key, value: Value) -> bool
Push the given key-value pair to the top of the object.
Returns true if the key was not already present in the object,
and false otherwise.
Any previous entry matching the key is not overridden: duplicates
are preserved, in order.
Runs in O(n).
pub fn push_entry_front(&mut self, entry: Entry) -> bool
Sourcepub fn insert(
&mut self,
key: Key,
value: Value,
) -> Option<RemovedByInsertion<'_>>
pub fn insert( &mut self, key: Key, value: Value, ) -> Option<RemovedByInsertion<'_>>
Inserts the given key-value pair.
If one or more entries are already matching the given key,
all of them are removed and returned in the resulting iterator.
Otherwise, None is returned.
Sourcepub fn insert_front(
&mut self,
key: Key,
value: Value,
) -> RemovedByInsertFront<'_>
pub fn insert_front( &mut self, key: Key, value: Value, ) -> RemovedByInsertFront<'_>
Inserts the given key-value pair on top of the object.
If one or more entries are already matching the given key, all of them are removed and returned in the resulting iterator.
Sourcepub fn sort(&mut self)
pub fn sort(&mut self)
Sort the entries by key name.
Entries with the same key are sorted by value.
Sourcepub fn try_remove_at(
&mut self,
index: usize,
) -> Result<Option<Entry>, EmptyObject>
pub fn try_remove_at( &mut self, index: usize, ) -> Result<Option<Entry>, EmptyObject>
Tries to remove the entry at the given index.
Returns an error if this would leave the object empty.
Sourcepub fn try_remove<'q, Q>(
&mut self,
key: &'q Q,
) -> Result<RemovedEntries<'_, 'q, Q>, EmptyObject>
pub fn try_remove<'q, Q>( &mut self, key: &'q Q, ) -> Result<RemovedEntries<'_, 'q, Q>, EmptyObject>
Tries to remove all entries associated to the given key.
Returns an error if this would leave the object empty.
Runs in O(n) time (average).
Sourcepub fn try_remove_unique<Q>(
&mut self,
key: &Q,
) -> Result<Option<Entry>, RemoveUniqueError>
pub fn try_remove_unique<Q>( &mut self, key: &Q, ) -> Result<Option<Entry>, RemoveUniqueError>
Tries to remove the unique entry associated to the given key.
Returns an error if multiple entries match the key, or if the object would be left empty.
Runs in O(n) time (average).
Methods from Deref<Target = Object>§
pub fn capacity(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get_fragment(&self, index: usize) -> Result<FragmentRef<'_>, usize>
pub fn entries(&self) -> &[Entry]
pub fn iter(&self) -> Iter<'_, Entry>
pub fn iter_mapped<'m>( &self, code_map: &'m CodeMap, offset: usize, ) -> IterMapped<'_, 'm>
Sourcepub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn contains_key<Q>(&self, key: &Q) -> bool
Checks if this object contains the given key.
Runs in O(1) (average).
Sourcepub fn get<Q>(&self, key: &Q) -> Values<'_>
pub fn get<Q>(&self, key: &Q) -> Values<'_>
Returns an iterator over the values matching the given key.
Runs in O(1) (average).
Sourcepub fn get_unique<Q>(
&self,
key: &Q,
) -> Result<Option<&Value>, Duplicate<&Entry>>
pub fn get_unique<Q>( &self, key: &Q, ) -> Result<Option<&Value>, Duplicate<&Entry>>
Returns the unique entry value matching the given key.
Returns an error if multiple entries match the key.
Runs in O(1) (average).
Sourcepub fn get_entries<Q>(&self, key: &Q) -> Entries<'_>
pub fn get_entries<Q>(&self, key: &Q) -> Entries<'_>
Returns an iterator over the entries matching the given key.
Runs in O(1) (average).
Sourcepub fn get_unique_entry<Q>(
&self,
key: &Q,
) -> Result<Option<&Entry>, Duplicate<&Entry>>
pub fn get_unique_entry<Q>( &self, key: &Q, ) -> Result<Option<&Entry>, Duplicate<&Entry>>
Returns the unique entry matching the given key.
Returns an error if multiple entries match the key.
Runs in O(1) (average).
Sourcepub fn get_with_index<Q>(&self, key: &Q) -> ValuesWithIndex<'_>
pub fn get_with_index<Q>(&self, key: &Q) -> ValuesWithIndex<'_>
Returns an iterator over the values matching the given key.
Runs in O(1) (average).
Sourcepub fn get_entries_with_index<Q>(&self, key: &Q) -> EntriesWithIndex<'_>
pub fn get_entries_with_index<Q>(&self, key: &Q) -> EntriesWithIndex<'_>
Returns an iterator over the entries matching the given key.
Runs in O(1) (average).
pub fn index_of<Q>(&self, key: &Q) -> Option<usize>
pub fn redundant_index_of<Q>(&self, key: &Q) -> Option<usize>
pub fn indexes_of<Q>(&self, key: &Q) -> Indexes<'_>
Sourcepub fn get_mapped_entries<'m, Q>(
&self,
code_map: &'m CodeMap,
offset: usize,
key: &Q,
) -> MappedEntries<'_, 'm>
pub fn get_mapped_entries<'m, Q>( &self, code_map: &'m CodeMap, offset: usize, key: &Q, ) -> MappedEntries<'_, 'm>
Returns an iterator over the mapped entries matching the given key.
Runs in O(n) (average). O(1) to find the entry, O(n) to compute
the entry fragment offset.
Sourcepub fn get_unique_mapped_entry<Q>(
&self,
code_map: &CodeMap,
offset: usize,
key: &Q,
) -> Result<Option<Mapped<Entry<Mapped<&SmallString<[u8; 16]>>, Mapped<&Value>>>>, Duplicate<Mapped<Entry<Mapped<&SmallString<[u8; 16]>>, Mapped<&Value>>>>>
pub fn get_unique_mapped_entry<Q>( &self, code_map: &CodeMap, offset: usize, key: &Q, ) -> Result<Option<Mapped<Entry<Mapped<&SmallString<[u8; 16]>>, Mapped<&Value>>>>, Duplicate<Mapped<Entry<Mapped<&SmallString<[u8; 16]>>, Mapped<&Value>>>>>
Returns the unique mapped entry matching the given key.
Runs in O(n) (average). O(1) to find the entry, O(n) to compute
the entry fragment offset.
Sourcepub fn get_mapped_entries_with_index<'m, Q>(
&self,
code_map: &'m CodeMap,
offset: usize,
key: &Q,
) -> MappedEntriesWithIndex<'_, 'm>
pub fn get_mapped_entries_with_index<'m, Q>( &self, code_map: &'m CodeMap, offset: usize, key: &Q, ) -> MappedEntriesWithIndex<'_, 'm>
Returns an iterator over the mapped entries matching the given key, with their index.
Runs in O(n) (average). O(1) to find the entry, O(n) to compute
the entry fragment offset.
Sourcepub fn get_unique_mapped_entry_with_index<Q>(
&self,
code_map: &CodeMap,
offset: usize,
key: &Q,
) -> Result<Option<(usize, Mapped<Entry<Mapped<&SmallString<[u8; 16]>>, Mapped<&Value>>>)>, Duplicate<(usize, Mapped<Entry<Mapped<&SmallString<[u8; 16]>>, Mapped<&Value>>>)>>
pub fn get_unique_mapped_entry_with_index<Q>( &self, code_map: &CodeMap, offset: usize, key: &Q, ) -> Result<Option<(usize, Mapped<Entry<Mapped<&SmallString<[u8; 16]>>, Mapped<&Value>>>)>, Duplicate<(usize, Mapped<Entry<Mapped<&SmallString<[u8; 16]>>, Mapped<&Value>>>)>>
Returns the unique mapped entry matching the given key, with its index.
Runs in O(n) (average). O(1) to find the entry, O(n) to compute
the entry fragment offset.
Sourcepub fn get_mapped<'m, Q>(
&self,
code_map: &'m CodeMap,
offset: usize,
key: &Q,
) -> MappedValues<'_, 'm>
pub fn get_mapped<'m, Q>( &self, code_map: &'m CodeMap, offset: usize, key: &Q, ) -> MappedValues<'_, 'm>
Returns an iterator over the mapped values matching the given key.
Runs in O(n) (average). O(1) to find the entry, O(n) to compute
the entry fragment offset.
Sourcepub fn get_unique_mapped<Q>(
&self,
code_map: &CodeMap,
offset: usize,
key: &Q,
) -> Result<Option<Mapped<&Value>>, Duplicate<Mapped<&Value>>>
pub fn get_unique_mapped<Q>( &self, code_map: &CodeMap, offset: usize, key: &Q, ) -> Result<Option<Mapped<&Value>>, Duplicate<Mapped<&Value>>>
Returns the unique mapped values matching the given key.
Runs in O(n) (average). O(1) to find the entry, O(n) to compute
the entry fragment offset.
Sourcepub fn get_mapped_with_index<'m, Q>(
&self,
code_map: &'m CodeMap,
offset: usize,
key: &Q,
) -> MappedValuesWithIndex<'_, 'm>
pub fn get_mapped_with_index<'m, Q>( &self, code_map: &'m CodeMap, offset: usize, key: &Q, ) -> MappedValuesWithIndex<'_, 'm>
Returns an iterator over the mapped values matching the given key, with their index.
Runs in O(n) (average). O(1) to find the entry, O(n) to compute
the entry fragment offset.
Sourcepub fn get_unique_mapped_with_index<Q>(
&self,
code_map: &CodeMap,
offset: usize,
key: &Q,
) -> Result<Option<(usize, Mapped<&Value>)>, Duplicate<(usize, Mapped<&Value>)>>
pub fn get_unique_mapped_with_index<Q>( &self, code_map: &CodeMap, offset: usize, key: &Q, ) -> Result<Option<(usize, Mapped<&Value>)>, Duplicate<(usize, Mapped<&Value>)>>
Returns the unique mapped values matching the given key, with its index.
Runs in O(n) (average). O(1) to find the entry, O(n) to compute
the entry fragment offset.
pub fn first(&self) -> Option<&Entry>
pub fn last(&self) -> Option<&Entry>
Trait Implementations§
Source§impl AsRef<Object> for NonEmptyObject
impl AsRef<Object> for NonEmptyObject
Source§impl Borrow<Object> for NonEmptyObject
impl Borrow<Object> for NonEmptyObject
Source§impl Clone for NonEmptyObject
impl Clone for NonEmptyObject
Source§fn clone(&self) -> NonEmptyObject
fn clone(&self) -> NonEmptyObject
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NonEmptyObject
impl Debug for NonEmptyObject
Source§impl Deref for NonEmptyObject
impl Deref for NonEmptyObject
Source§impl<'de> Deserialize<'de> for NonEmptyObject
impl<'de> Deserialize<'de> for NonEmptyObject
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl From<NonEmptyObject> for Object
impl From<NonEmptyObject> for Object
Source§fn from(value: NonEmptyObject) -> Self
fn from(value: NonEmptyObject) -> Self
Source§impl Hash for NonEmptyObject
impl Hash for NonEmptyObject
Source§impl Ord for NonEmptyObject
impl Ord for NonEmptyObject
Source§fn cmp(&self, other: &NonEmptyObject) -> Ordering
fn cmp(&self, other: &NonEmptyObject) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for NonEmptyObject
impl PartialEq for NonEmptyObject
Source§impl PartialOrd for NonEmptyObject
impl PartialOrd for NonEmptyObject
Source§impl Serialize for NonEmptyObject
impl Serialize for NonEmptyObject
Source§impl TryFrom<Object> for NonEmptyObject
impl TryFrom<Object> for NonEmptyObject
impl Eq for NonEmptyObject
impl StructuralPartialEq for NonEmptyObject
Auto Trait Implementations§
impl Freeze for NonEmptyObject
impl RefUnwindSafe for NonEmptyObject
impl Send for NonEmptyObject
impl Sync for NonEmptyObject
impl Unpin for NonEmptyObject
impl UnwindSafe for NonEmptyObject
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
fn deserialize_typed<S>(
_: &C,
deserializer: S,
) -> Result<T, <S as Deserializer<'de>>::Error>where
S: Deserializer<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§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> PipeAsRef for T
impl<T> PipeAsRef for T
Source§impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
Source§impl<T> PipeDeref for T
impl<T> PipeDeref for T
Source§impl<T> PipeRef for T
impl<T> PipeRef for T
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T.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.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
Source§fn tap_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
tap in debug builds, and does nothing in release builds.Source§fn tap_mut<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
Source§fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
tap_mut in debug builds, and does nothing in release builds.Source§impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
Source§fn tap_ref<F, R>(self, func: F) -> Self
fn tap_ref<F, R>(self, func: F) -> Self
Source§fn tap_ref_dbg<F, R>(self, func: F) -> Self
fn tap_ref_dbg<F, R>(self, func: F) -> Self
tap_ref in debug builds, and does nothing in release builds.Source§fn tap_ref_mut<F, R>(self, func: F) -> Self
fn tap_ref_mut<F, R>(self, func: F) -> Self
Source§impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
Source§fn tap_borrow<F, R>(self, func: F) -> Self
fn tap_borrow<F, R>(self, func: F) -> Self
Source§fn tap_borrow_dbg<F, R>(self, func: F) -> Self
fn tap_borrow_dbg<F, R>(self, func: F) -> Self
tap_borrow in debug builds, and does nothing in release builds.Source§fn tap_borrow_mut<F, R>(self, func: F) -> Self
fn tap_borrow_mut<F, R>(self, func: F) -> Self
Source§impl<T> TapDeref for T
impl<T> TapDeref for T
Source§fn tap_deref_dbg<F, R>(self, func: F) -> Self
fn tap_deref_dbg<F, R>(self, func: F) -> Self
tap_deref in debug builds, and does nothing in release builds.Source§fn tap_deref_mut<F, R>(self, func: F) -> Self
fn tap_deref_mut<F, R>(self, func: F) -> Self
self for modification.