pub enum GenerateError {
UnsupportedSurfaceApi {
found: u32,
expected: u32,
},
NoTablesModule {
modules: Vec<String>,
},
UnknownAction {
action: String,
},
UnreadableAction {
action: String,
why: String,
},
UnsupportedTableName {
table: String,
},
}Expand description
Why generation refused. Every case is a contract this generator cannot
honour, and every Display says what to do about it.
Variants§
UnsupportedSurfaceApi
The document’s surface_api is not the contract this generator
speaks: a newer (or corrupted) server than the generator.
NoTablesModule
The document declares no tables module, so there is no contract
to generate a client from.
UnknownAction
An action in the Tables module whose name is not one of the five
verbs the module publishes (list-/read-/create-/
replace-/delete-, then the table name).
UnreadableAction
An action whose name parses but whose method or path is not what its verb promises — a contract drifted from its own vocabulary.
UnsupportedTableName
A table whose name is not a safe identifier: lowercase snake-case
([a-z][a-z0-9_]*, no double or trailing underscore), the same
rule cratefield_tables::is_identifier enforces on a declaration.
The /__surface document is untrusted input — the documented usage
is curl -s https://venture/__surface | fz client-ts — and the
name is interpolated into the generated TypeScript, so anything it
cannot spell is refused rather than renamed: a silently renamed
table would produce a client that calls the wrong route.
Trait Implementations§
Source§impl Clone for GenerateError
impl Clone for GenerateError
Source§impl Debug for GenerateError
impl Debug for GenerateError
Source§impl Display for GenerateError
impl Display for GenerateError
impl Eq for GenerateError
Source§impl Error for GenerateError
impl Error for GenerateError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for GenerateError
impl PartialEq for GenerateError
impl StructuralPartialEq for GenerateError
Auto Trait Implementations§
impl Freeze for GenerateError
impl RefUnwindSafe for GenerateError
impl Send for GenerateError
impl Sync for GenerateError
impl Unpin for GenerateError
impl UnsafeUnpin for GenerateError
impl UnwindSafe for GenerateError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.