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

Method from

core/station/impl/src/mappers/request_status.rs:6–23  ·  view source on GitHub ↗
(status: RequestStatus)

Source from the content-addressed store, hash-verified

4
5impl From<RequestStatus> for RequestStatusDTO {
6 fn from(status: RequestStatus) -> Self {
7 match status {
8 RequestStatus::Created => RequestStatusDTO::Created,
9 RequestStatus::Approved => RequestStatusDTO::Approved,
10 RequestStatus::Rejected => RequestStatusDTO::Rejected,
11 RequestStatus::Completed { completed_at } => RequestStatusDTO::Completed {
12 completed_at: timestamp_to_rfc3339(&completed_at),
13 },
14 RequestStatus::Failed { reason } => RequestStatusDTO::Failed { reason },
15 RequestStatus::Processing { started_at } => RequestStatusDTO::Processing {
16 started_at: timestamp_to_rfc3339(&started_at),
17 },
18 RequestStatus::Scheduled { scheduled_at } => RequestStatusDTO::Scheduled {
19 scheduled_at: timestamp_to_rfc3339(&scheduled_at),
20 },
21 RequestStatus::Cancelled { reason } => RequestStatusDTO::Cancelled { reason },
22 }
23 }
24}
25
26impl From<RequestStatus> for RequestStatusCodeDTO {

Callers

nothing calls this directly

Calls 2

timestamp_to_rfc3339Function · 0.85
rfc3339_to_timestampFunction · 0.85

Tested by

no test coverage detected