MCPcopy Create free account
hub / github.com/RustCrypto/utils / map

Method map

ctutils/src/ct_option.rs:319–324  ·  view source on GitHub ↗
(self, f: F)

Source from the content-addressed store, hash-verified

317 #[inline]
318 #[must_use]
319 pub fn map<U, F>(self, f: F) -> CtOption<U>
320 where
321 F: FnOnce(T) -> U,
322 {
323 CtOption::new(f(self.value), self.is_some)
324 }
325
326 /// Maps a `CtOption<T>` to a `U` value, eagerly evaluating the provided function, and returning
327 /// the supplied `default` in the event `self.is_some()` is [`Choice::FALSE`].

Callers 12

encode_blobsFunction · 0.80
decode_hexFunction · 0.80
test_async_readFunction · 0.80
test_async_writeFunction · 0.80
as_derefMethod · 0.80
as_deref_mutMethod · 0.80
map_orMethod · 0.80
zip_withMethod · 0.80
derive_zeroize_implFunction · 0.80
generate_fieldsFunction · 0.80
attr_skipFunction · 0.80
get_tail_blockMethod · 0.80

Calls

no outgoing calls

Tested by 2

test_async_readFunction · 0.64
test_async_writeFunction · 0.64