MCPcopy Create free account
hub / github.com/dfinity/orbit / from

Method from

core/station/impl/src/mappers/transfer_status.rs:6–25  ·  view source on GitHub ↗
(status: TransferStatus)

Source from the content-addressed store, hash-verified

4
5impl From<TransferStatus> for TransferStatusDTO {
6 fn from(status: TransferStatus) -> Self {
7 match status {
8 TransferStatus::Processing { started_at } => TransferStatusDTO::Processing {
9 started_at: timestamp_to_rfc3339(&started_at),
10 },
11 TransferStatus::Created => TransferStatusDTO::Created,
12 TransferStatus::Completed {
13 signature,
14 hash,
15 completed_at,
16 } => TransferStatusDTO::Completed {
17 signature: signature.map(|s| s.to_owned()),
18 hash: hash.map(|h| h.to_owned()),
19 completed_at: timestamp_to_rfc3339(&completed_at),
20 },
21 TransferStatus::Failed { reason } => TransferStatusDTO::Failed {
22 reason: reason.to_owned(),
23 },
24 }
25 }
26}
27
28impl From<TransferStatus> for TransferStatusTypeDTO {

Callers

nothing calls this directly

Calls 2

timestamp_to_rfc3339Function · 0.85
mapMethod · 0.80

Tested by

no test coverage detected