summaryrefslogtreecommitdiff
path: root/ops/op2/signature.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ops/op2/signature.rs')
-rw-r--r--ops/op2/signature.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/ops/op2/signature.rs b/ops/op2/signature.rs
index 15c40e007..5d472fcf3 100644
--- a/ops/op2/signature.rs
+++ b/ops/op2/signature.rs
@@ -106,6 +106,7 @@ pub enum Special {
HandleScope,
OpState,
String,
+ CowStr,
RefStr,
FastApiCallbackOptions,
}
@@ -431,6 +432,17 @@ fn parse_type_path(attrs: Attributes, tp: &TypePath) -> Result<Arg, ArgError> {
Err(ArgError::MissingStringAttribute)
}
}
+ ( $( std :: str :: )? str ) => {
+ // We should not hit this path with a #[string] argument
+ Err(ArgError::MissingStringAttribute)
+ }
+ ( $( std :: borrow :: )? Cow < str > ) => {
+ if attrs.primary == Some(AttributeModifier::String) {
+ Ok(Arg::Special(Special::CowStr))
+ } else {
+ Err(ArgError::MissingStringAttribute)
+ }
+ }
( $( std :: ffi :: )? c_void ) => Ok(Arg::Numeric(NumericArg::__VOID__)),
( OpState ) => Ok(Arg::Special(Special::OpState)),
( v8 :: HandleScope ) => Ok(Arg::Special(Special::HandleScope)),