MCPcopy Create free account
hub / github.com/docknetwork/crypto / try_map_ref_mut

Method try_map_ref_mut

coconut/src/setup/keygen/common.rs:107–117  ·  view source on GitHub ↗

Attempts to apply given `f` to the mutable reference of each contained entity producing a new `SecretKeyModel`.

(&mut self, mut map: F)

Source from the content-addressed store, hash-verified

105impl<X> SecretKeyModel<X> {
106 /// Attempts to apply given `f` to the mutable reference of each contained entity producing a new `SecretKeyModel`.
107 pub(crate) fn try_map_ref_mut<F, R, E>(&mut self, mut map: F) -> Result<SecretKeyModel<R>, E>
108 where
109 F: FnMut(&mut X) -> Result<R, E>,
110 {
111 let Self { x, y } = self;
112
113 Ok(SecretKeyModel {
114 x: map(x)?,
115 y: y.iter_mut().map(map).try_collect()?,
116 })
117 }
118
119 /// Applies given `f` to the mutable reference of each contained entity producing a new `SecretKeyModel`.
120 pub(crate) fn map_ref_mut<F, R>(&mut self, mut f: F) -> SecretKeyModel<R>

Callers 1

dealFunction · 0.80

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected