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

Method get_session_message

graphlite/src/exec/result.rs:119–145  ·  view source on GitHub ↗

Get a formatted message for session commands (returns None if not a session command)

(&self)

Source from the content-addressed store, hash-verified

117
118 /// Get a formatted message for session commands (returns None if not a session command)
119 pub fn get_session_message(&self) -> Option<String> {
120 self.session_result.as_ref().map(|sr| match sr {
121 SessionResult::SetGraph {
122 graph_expression,
123 validated: _,
124 } => {
125 let graph_path = match graph_expression {
126 GraphExpression::Reference(path) => path.to_string(),
127 GraphExpression::Union { .. } => "UNION expression".to_string(),
128 GraphExpression::CurrentGraph => "CURRENT_GRAPH".to_string(),
129 };
130 format!("Session graph set to: {}", graph_path)
131 }
132 SessionResult::SetSchema {
133 schema_reference,
134 validated: _,
135 } => {
136 let schema_path = format!("/{}", schema_reference.segments.join("/"));
137 format!("Session schema set to: {}", schema_path)
138 }
139 SessionResult::SetTimeZone { timezone } => {
140 format!("Session timezone set to: {}", timezone)
141 }
142 SessionResult::Reset => "Session reset to defaults".to_string(),
143 SessionResult::Close => "Session closed".to_string(),
144 })
145 }
146}
147
148/// Single result row representing variable bindings

Callers 1

format_tableMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected