(value: SessionRecordV2)
| 362 | |
| 363 | impl From<SessionRecordV2> for SessionRecord { |
| 364 | fn from(value: SessionRecordV2) -> Self { |
| 365 | let status = match value.status { |
| 366 | // The refusal reason, paths and recovery ref survive the decode |
| 367 | // (review R1: an exact pre-CB12A incomplete SessionRecord used to |
| 368 | // decode as Active, discarding the refusal). |
| 369 | SessionStatusV2::Incomplete(incomplete) => { |
| 370 | SessionStatus::Incomplete(IncompleteSession { |
| 371 | reason: incomplete.reason, |
| 372 | paths: incomplete.paths, |
| 373 | recovery_ref: incomplete.recovery_ref, |
| 374 | origin: incomplete.origin, |
| 375 | unbound_commits: Vec::new(), |
| 376 | }) |
| 377 | } |
| 378 | SessionStatusV2::Active => SessionStatus::Active, |
| 379 | SessionStatusV2::Ended => SessionStatus::Ended, |
| 380 | }; |
| 381 | Self { |
| 382 | session_id: value.session_id, |
| 383 | json_path: value.json_path, |
| 384 | view_name: value.view_name, |
| 385 | parent_view: value.parent_view, |
| 386 | first_provenance: value.first_provenance, |
| 387 | latest_provenance: value.latest_provenance, |
| 388 | turn_count: value.turn_count, |
| 389 | started_at: value.started_at, |
| 390 | ended_at: value.ended_at, |
| 391 | status, |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | impl From<SessionRecordV1> for SessionRecord { |
nothing calls this directly
no outgoing calls
no test coverage detected