MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / get

Method get

atomic-repository/src/repository/resurrection.rs:174–191  ·  view source on GitHub ↗
(
        &mut self,
        hash: &Hash,
    )

Source from the content-addressed store, hash-verified

172
173impl ClosureChangeSource for LocalClosureSource<'_> {
174 fn get(
175 &mut self,
176 hash: &Hash,
177 ) -> Result<Option<atomic_core::change::Change>, BindingClosureError> {
178 if !self.repo.has_change(hash) {
179 return Ok(None);
180 }
181 self.repo
182 .load_change(hash)
183 .map(Some)
184 .map_err(|error| BindingClosureError::Quarantine {
185 hash: hash.to_base32(),
186 source: BindingPackError::ChangeDecode {
187 key: hash.to_base32(),
188 reason: error.to_string(),
189 },
190 })
191 }
192}
193
194fn pristine_map(error: atomic_core::pristine::PristineError) -> RepositoryError {

Callers

nothing calls this directly

Calls 3

has_changeMethod · 0.45
load_changeMethod · 0.45
to_base32Method · 0.45

Tested by

no test coverage detected