Skip to main content

sql_fun_sqlast/sem/parse_context/
cast_info.rs

1use std::collections::HashSet;
2
3use crate::sem::{CastDefinition, TypeReference};
4
5/// get cast definition
6pub trait CastInfoRead {
7    /// get explicit cast operation
8    fn get_explicit_cast(
9        &self,
10        source_type: &TypeReference,
11        target_type: &TypeReference,
12    ) -> Option<CastDefinition>;
13
14    /// get implicit cast operation
15    fn get_implicit_cast(
16        &self,
17        source_type: &TypeReference,
18        target_type: &TypeReference,
19    ) -> Option<CastDefinition>;
20
21    /// list implicit castable types from `source_type`
22    fn get_implicit_castable(&self, source_type: &TypeReference) -> HashSet<TypeReference>;
23}