MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / fmt

Method fmt

graphlite/src/types/mod.rs:51–81  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

49
50impl fmt::Display for TypeError {
51 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
52 match self {
53 TypeError::IncompatibleTypes(t1, t2) => {
54 write!(f, "Incompatible types: {} and {}", t1, t2)
55 }
56 TypeError::InvalidCast(from, to) => {
57 write!(f, "Cannot cast from {} to {}", from, to)
58 }
59 TypeError::TypeMismatch { expected, actual } => {
60 write!(f, "Type mismatch: expected {}, got {}", expected, actual)
61 }
62 TypeError::InvalidTypeSpecification(msg) => {
63 write!(f, "Invalid type specification: {}", msg)
64 }
65 TypeError::NullabilityViolation(msg) => {
66 write!(f, "Nullability violation: {}", msg)
67 }
68 TypeError::CollectionTypeMismatch(msg) => {
69 write!(f, "Collection type mismatch: {}", msg)
70 }
71 TypeError::GraphSchemaViolation(msg) => {
72 write!(f, "Graph schema violation: {}", msg)
73 }
74 TypeError::NumericOverflow(msg) => {
75 write!(f, "Numeric overflow: {}", msg)
76 }
77 TypeError::UnknownType(name) => {
78 write!(f, "Unknown type: {}", name)
79 }
80 }
81 }
82}
83
84impl std::error::Error for TypeError {}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected