Attempts to apply given `f` to the mutable reference of each contained entity producing a new `SecretKeyModel`.
(&mut self, mut map: F)
| 105 | impl<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> |