MCPcopy Create free account
hub / github.com/Botloader/botloader / from

Method from

components/stores/src/bucketstore.rs:406–421  ·  view source on GitHub ↗
(v: DbEntry)

Source from the content-addressed store, hash-verified

404
405impl From<DbEntry> for Entry {
406 fn from(v: DbEntry) -> Self {
407 Self {
408 bucket: v.bucket,
409 plugin_id: (v.plugin_id > 0).then_some(v.plugin_id as u64),
410 key: v.key,
411 expires_at: v.expires_at,
412 value: if let Some(fv) = v.value_float {
413 OpStorageBucketValue::Double(fv)
414 } else if let Some(sv) = v.value_json {
415 OpStorageBucketValue::Json(sv)
416 } else {
417 error!("got neither float nor json value from db");
418 OpStorageBucketValue::Json(serde_json::Value::Null)
419 },
420 }
421 }
422}
423
424impl From<sqlx::Error> for StoreError {

Callers

nothing calls this directly

Calls 1

NotBigU64Class · 0.85

Tested by

no test coverage detected