MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / try_from

Method try_from

src/sql-server-util/src/desc.rs:173–182  ·  view source on GitHub ↗
(value: String)

Source from the content-addressed store, hash-verified

171 type Error = SqlServerError;
172
173 fn try_from(value: String) -> Result<Self, Self::Error> {
174 match value.as_str() {
175 "PRIMARY KEY" => Ok(Self::PrimaryKey),
176 "UNIQUE" => Ok(Self::Unique),
177 name => Err(SqlServerError::InvalidData {
178 column_name: "constraint_type".into(),
179 error: format!("Unknown constraint type: {name}"),
180 }),
181 }
182 }
183}
184
185impl RustType<proto_sql_server_table_constraint::ConstraintType> for SqlServerTableConstraintType {

Callers

nothing calls this directly

Calls 3

as_strMethod · 0.45
try_intoMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected