about summary refs log blame commit diff
path: root/tvix/derivation/src/output.rs
blob: 0d668c3e995240fa68ef3380927c444ad9919227 (plain) (tree)
1
2
3
4
5

                                    


                                 








                                 
                                 






                                    
 
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
pub struct Output {
    pub path: String,

    #[serde(flatten)]
    pub hash: Option<Hash>,
}

#[derive(Serialize, Deserialize)]
pub struct Hash {
    #[serde(rename = "hash")]
    pub digest: String,
    #[serde(rename = "hashAlgo")]
    pub algo: String,
}

impl Output {
    pub fn is_fixed(&self) -> bool {
        self.hash.is_some()
    }
}