LCOV - code coverage report
Current view: top level - pageserver/src/virtual_file - metadata.rs (source / functions) Coverage Total Hit
Test: aca806cab4756d7eb6a304846130f4a73a5d5393.info Lines: 100.0 % 11 11
Test Date: 2025-04-24 20:31:15 Functions: 100.0 % 3 3

            Line data    Source code
       1              : use std::fs;
       2              : 
       3              : pub enum Metadata {
       4              :     StdFs(fs::Metadata),
       5              :     #[cfg(target_os = "linux")]
       6              :     TokioEpollUring(Box<tokio_epoll_uring::ops::statx::statx>),
       7              : }
       8              : 
       9              : #[cfg(target_os = "linux")]
      10              : impl From<Box<tokio_epoll_uring::ops::statx::statx>> for Metadata {
      11         5496 :     fn from(value: Box<tokio_epoll_uring::ops::statx::statx>) -> Self {
      12         5496 :         Metadata::TokioEpollUring(value)
      13         5496 :     }
      14              : }
      15              : 
      16              : impl From<std::fs::Metadata> for Metadata {
      17         5496 :     fn from(value: std::fs::Metadata) -> Self {
      18         5496 :         Metadata::StdFs(value)
      19         5496 :     }
      20              : }
      21              : 
      22              : impl Metadata {
      23        19692 :     pub fn len(&self) -> u64 {
      24        19692 :         match self {
      25         9846 :             Metadata::StdFs(metadata) => metadata.len(),
      26              :             #[cfg(target_os = "linux")]
      27         9846 :             Metadata::TokioEpollUring(statx) => statx.stx_size,
      28              :         }
      29        19692 :     }
      30              : }
        

Generated by: LCOV version 2.1-beta