• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TyRoXx / NonlocalityOS / 14775665818

01 May 2025 12:51PM UTC coverage: 76.501% (-1.1%) from 77.611%
14775665818

Pull #221

github

web-flow
Merge ad66be2f7 into 3008f5ee2
Pull Request #221: Hello world

281 of 359 new or added lines in 9 files covered. (78.27%)

15 existing lines in 3 files now uncovered.

3949 of 5162 relevant lines covered (76.5%)

1826.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.32
/lambda/src/types.rs
1
use astraea::{
2
    storage::LoadValue,
3
    tree::{BlobDigest, Value},
4
};
5
use serde::{Deserialize, Serialize};
6
use std::{collections::BTreeMap, fmt::Display};
7
use uuid::Uuid;
8

9
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Serialize, Deserialize)]
10
pub struct NamespaceId(pub [u8; 16]);
11

12
impl NamespaceId {
13
    pub fn random() -> Self {
×
14
        Self(Uuid::new_v4().into_bytes())
×
15
    }
16
}
17

18
impl Display for NamespaceId {
19
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11✔
20
        write!(f, "{}", Uuid::from_bytes(self.0))
11✔
21
    }
22
}
23

24
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Serialize, Deserialize)]
25
pub struct Name {
26
    pub namespace: NamespaceId,
27
    pub key: String,
28
}
29

30
impl Name {
31
    pub fn new(namespace: NamespaceId, key: String) -> Self {
25✔
32
        Self { namespace, key }
33
    }
34
}
35

36
impl Display for Name {
37
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11✔
38
        write!(f, "{}.{}", self.namespace, self.key)
11✔
39
    }
40
}
41

42
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Serialize, Deserialize)]
43
pub struct Signature {
44
    pub argument: BlobDigest,
45
    pub result: BlobDigest,
46
}
47

48
impl Signature {
NEW
49
    pub fn new(argument: BlobDigest, result: BlobDigest) -> Self {
×
50
        Self { argument, result }
51
    }
52
}
53

54
#[derive(Debug, PartialEq, PartialOrd, Hash, Clone, Serialize, Deserialize)]
55
pub struct Interface {
56
    pub methods: BTreeMap<Name, Signature>,
57
}
58

59
impl Interface {
UNCOV
60
    pub fn new(methods: BTreeMap<Name, Signature>) -> Self {
×
61
        Self { methods }
62
    }
63
}
64

65
#[derive(Debug, PartialEq, Eq, Ord, PartialOrd, Hash, Clone)]
66
pub enum Type {
67
    Named(Name),
68
    Unit,
69
    Option(BlobDigest),
70
    Function(Box<Signature>),
71
    Reference,
72
}
73

74
impl Type {
NEW
75
    pub fn print(&self, writer: &mut dyn std::fmt::Write) -> std::fmt::Result {
×
UNCOV
76
        match self {
×
UNCOV
77
            Type::Named(name) => write!(writer, "{}", &name.key),
×
78
            Type::Unit => write!(writer, "()"),
×
79
            Type::Option(blob_digest) => write!(writer, "Option<{}>", blob_digest),
×
80
            Type::Function(signature) => {
×
NEW
81
                write!(writer, "{} -> {}", &signature.argument, &signature.result)
×
82
            }
83
            Type::Reference => write!(writer, "Reference"),
×
84
        }
85
    }
86

NEW
87
    pub fn deserialize(_value: &Value, _load_value: &(dyn LoadValue + Sync)) -> Option<Type> {
×
88
        todo!()
89
    }
90

NEW
91
    pub fn to_value(&self) -> Value {
×
92
        todo!()
93
    }
94
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc