MCPcopy Create free account
hub / github.com/biblius/validify / is_option

Method is_option

validify_derive/src/fields.rs:324–333  ·  view source on GitHub ↗

Returns true if the field is an option.

(&self)

Source from the content-addressed store, hash-verified

322
323 /// Returns true if the field is an option.
324 pub fn is_option(&self) -> bool {
325 let syn::Type::Path(ref p) = self.field.ty else {
326 return false;
327 };
328
329 p.path
330 .segments
331 .last()
332 .is_some_and(|seg| seg.ident == "Option")
333 }
334
335 /// Returns true if the field is &'_ T, or Option<&'_ T>.
336 pub fn is_reference(&self) -> bool {

Callers 11

to_validify_tokensMethod · 0.80
quote_validator_paramMethod · 0.80
quote_modifier_paramMethod · 0.80
quote_validator_fieldMethod · 0.80
wrap_tokens_if_optionMethod · 0.80
map_payload_fieldsFunction · 0.80
map_from_fieldsFunction · 0.80
map_into_fieldsFunction · 0.80
to_validify_tokensMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected