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

vortex-data / vortex / 16935267080

13 Aug 2025 11:00AM UTC coverage: 24.312% (-63.3%) from 87.658%
16935267080

Pull #4226

github

web-flow
Merge 81b48c7fb into baa6ea202
Pull Request #4226: Support converting TimestampTZ to and from duckdb

0 of 2 new or added lines in 1 file covered. (0.0%)

20666 existing lines in 469 files now uncovered.

8726 of 35892 relevant lines covered (24.31%)

147.74 hits per line

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

0.0
/vortex-expr/src/scope_vars.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use std::any::{Any, TypeId};
5
use std::hash::{BuildHasherDefault, Hasher};
6

7
use vortex_utils::aliases::hash_map::HashMap;
8

9
/// A TypeMap based on `https://docs.rs/http/1.2.0/src/http/extensions.rs.html#41-266`.
10
pub(crate) type ScopeVars = HashMap<TypeId, Box<dyn ScopeVar>, BuildHasherDefault<IdHasher>>;
11

12
/// With TypeIds as keys, there's no need to hash them. They are already hashes
13
/// themselves, coming from the compiler. The IdHasher just holds the u64 of
14
/// the TypeId, and then returns it, instead of doing any bit fiddling.
15
#[derive(Default)]
16
pub(super) struct IdHasher(u64);
17

18
impl Hasher for IdHasher {
19
    #[inline]
UNCOV
20
    fn finish(&self) -> u64 {
×
UNCOV
21
        self.0
×
UNCOV
22
    }
×
23

24
    fn write(&mut self, _: &[u8]) {
×
25
        unreachable!("TypeId calls write_u64");
×
26
    }
27

28
    #[inline]
UNCOV
29
    fn write_u64(&mut self, id: u64) {
×
UNCOV
30
        self.0 = id;
×
UNCOV
31
    }
×
32
}
33

34
/// A trait for scope variables that can be stored in a `ScopeVars` map.
35
pub trait ScopeVar: Any + Send + Sync {
36
    fn as_any(&self) -> &dyn Any;
37
    fn as_any_mut(&mut self) -> &mut dyn Any;
38
    fn clone_box(&self) -> Box<dyn ScopeVar>;
39
}
40

41
impl Clone for Box<dyn ScopeVar> {
42
    fn clone(&self) -> Self {
×
43
        (**self).clone_box()
×
44
    }
×
45
}
46

47
impl<T: Clone + Send + Sync + 'static> ScopeVar for T {
UNCOV
48
    fn as_any(&self) -> &dyn Any {
×
UNCOV
49
        self
×
UNCOV
50
    }
×
51

UNCOV
52
    fn as_any_mut(&mut self) -> &mut dyn Any {
×
UNCOV
53
        self
×
UNCOV
54
    }
×
55

56
    fn clone_box(&self) -> Box<dyn ScopeVar> {
×
57
        Box::new(self.clone())
×
58
    }
×
59
}
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