From 62d8bbb4f549c2f88e3330f906d5fde459848391 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Tue, 23 Apr 2024 20:20:31 -0700 Subject: [PATCH 1/2] Generate Dafny 4.6 version of SimpleString patch --- .../codegen-patches/rust/dafny-4.6.0.patch | 2162 +++++++++++++++++ 1 file changed, 2162 insertions(+) create mode 100644 TestModels/SimpleTypes/SimpleString/codegen-patches/rust/dafny-4.6.0.patch diff --git a/TestModels/SimpleTypes/SimpleString/codegen-patches/rust/dafny-4.6.0.patch b/TestModels/SimpleTypes/SimpleString/codegen-patches/rust/dafny-4.6.0.patch new file mode 100644 index 000000000..f029f1ca3 --- /dev/null +++ b/TestModels/SimpleTypes/SimpleString/codegen-patches/rust/dafny-4.6.0.patch @@ -0,0 +1,2162 @@ +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/dafny_impl/src/implementation_from_dafny.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/dafny_impl/src/implementation_from_dafny.rs +index 5200278d..00e2106e 100644 +--- b/TestModels/SimpleTypes/SimpleString/runtimes/rust/dafny_impl/src/implementation_from_dafny.rs ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/dafny_impl/src/implementation_from_dafny.rs +@@ -1,100 +1,447 @@ + #![allow(warnings, unconditional_panic)] + #![allow(nonstandard_style)] +-extern crate dafny_runtime; +-mod _System { +- #[derive(Clone, PartialEq)] +- #[repr(transparent)] +- pub struct nat(pub ::dafny_runtime::BigInt); +- impl ::dafny_runtime::DafnyErasable for nat { +- type Erased = ::dafny_runtime::BigInt; +- } +- impl ::dafny_runtime::DafnyUnerasable<::dafny_runtime::BigInt> for nat {} +- impl ::dafny_runtime::DafnyUnerasable for nat {} +- impl ::std::default::Default for nat { +- fn default() -> Self { +- nat(::std::default::Default::default()) ++pub extern crate dafny_runtime; ++pub extern crate dafny_standard_library; ++pub use dafny_standard_library::implementation_from_dafny::*; ++ ++pub mod r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes { ++ /* datatype DafnyCallEvent = DafnyCallEvent(input: I, output: O) */ ++ #[derive(Clone)] ++ pub struct DafnyCallEvent { ++ input: I, ++ output: O + } +- } +- impl ::dafny_runtime::DafnyPrint for nat { +- fn fmt_print(&self, _formatter: &mut ::std::fmt::Formatter, in_seq: bool) -> ::std::fmt::Result { +- ::dafny_runtime::DafnyPrint::fmt_print(&self.0, _formatter, in_seq) ++ impl ::core::fmt::Debug for ++ DafnyCallEvent { ++ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { ++ f.debug_struct("DafnyCallEvent").field("input", &self.input).field("output", &self.output).finish() ++ } + } +- } +- impl ::std::ops::Deref for nat { +- type Target = ::dafny_runtime::BigInt; +- fn deref(&self) -> &Self::Target { +- &self.0 ++ impl ::dafny_runtime::DafnyPrint for ++ DafnyCallEvent { ++ fn fmt_print(&self, f: &mut std::fmt::Formatter<'_>, in_seq: bool) -> std::fmt::Result { ++ write!(f, "simple.types.smithystring.internaldafny.types.DafnyCallEvent(")?; ++ self.input.fmt_print(f, false)?; ++ write!(f, ",")?; ++ self.output.fmt_print(f, false)?; ++ write!(f, ")") ++ } + } +- } +- #[derive(PartialEq)] +- pub enum Tuple2 { +- _T2 { _0: T0, _1: T1 }, +- _PhantomVariant(::std::marker::PhantomData::, ::std::marker::PhantomData::) +- } +- impl + Clone + ::dafny_runtime::DafnyPrint + ::std::default::Default + 'static,T1: ::dafny_runtime::DafnyErasable + ::dafny_runtime::DafnyUnerasable + Clone + ::dafny_runtime::DafnyPrint + ::std::default::Default + 'static>Tuple2 +- where ::Erased: ::std::cmp::PartialEq, ::Erased: ::std::cmp::PartialEq, { +- pub fn _0(&self) -> &T0 { +- match self { +- Tuple2::_T2 { _0, _1, } => _0, +- Tuple2::_PhantomVariant(..) => panic!() ++ impl ++ PartialEq> for DafnyCallEvent { ++ fn eq(&self, other: &DafnyCallEvent) -> bool { ++ self.input == other.input && self.output == other.output ++ } ++ } ++ impl Eq for DafnyCallEvent {} ++ impl ::core::hash::Hash for DafnyCallEvent { ++ fn hash(&self, state: &mut H) { ++ self.input.hash(state); ++ self.output.hash(state); + } + } +- pub fn _1(&self) -> &T1 { +- match self { +- Tuple2::_T2 { _0, _1, } => _1, +- Tuple2::_PhantomVariant(..) => panic!() ++ ++ /* ++ datatype GetStringInput = | GetStringInput ( ++ nameonly value: Option := Option.None ++ ) ++ */ ++ #[derive(Clone)] ++ pub enum GetStringInput { ++ GetStringInput { value: ::std::rc::Rc> } ++ } ++ impl ::std::convert::AsRef for &GetStringInput { ++ fn as_ref(&self) -> Self { ++ self + } + } +- } +- impl + Clone + ::dafny_runtime::DafnyPrint + ::std::default::Default + 'static,T1: ::dafny_runtime::DafnyErasable + ::dafny_runtime::DafnyUnerasable + Clone + ::dafny_runtime::DafnyPrint + ::std::default::Default + 'static>::dafny_runtime::DafnyErasable for Tuple2 { +- type Erased = Tuple2; +- } +- impl + Clone + ::dafny_runtime::DafnyPrint + ::std::default::Default + ::dafny_runtime::DafnyUnerasable + 'static,T1__Erased, T1: ::dafny_runtime::DafnyErasable + ::dafny_runtime::DafnyUnerasable + Clone + ::dafny_runtime::DafnyPrint + ::std::default::Default + ::dafny_runtime::DafnyUnerasable + 'static>::dafny_runtime::DafnyUnerasable> for Tuple2 {} +- impl + Clone + ::dafny_runtime::DafnyPrint + ::std::default::Default + 'static,T1: ::dafny_runtime::DafnyErasable + ::dafny_runtime::DafnyUnerasable + Clone + ::dafny_runtime::DafnyPrint + ::std::default::Default + 'static>::dafny_runtime::DafnyPrint for Tuple2 { +- fn fmt_print(&self, _formatter: &mut ::std::fmt::Formatter, _in_seq: bool) -> std::fmt::Result { +- match self { +- Tuple2::_T2 { _0, _1, } => { +- write!(_formatter, "_System.Tuple2._T2(")?; +- ::dafny_runtime::DafnyPrint::fmt_print(_0, _formatter, false)?; +- write!(_formatter, ", ")?; +- ::dafny_runtime::DafnyPrint::fmt_print(_1, _formatter, false)?; +- write!(_formatter, ")")?; +- Ok(()) +- }, +- Tuple2::_PhantomVariant(..) => {panic!()} ++ impl GetStringInput { ++ pub fn value(&self) -> ::std::rc::Rc> { ++ match self { ++ GetStringInput::GetStringInput { value } => { ++ value.clone() ++ } ++ } ++ } ++ } ++ impl ::core::fmt::Debug for GetStringInput { ++ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { ++ ::dafny_runtime::DafnyPrint::fmt_print(self, f, false) ++ } ++ } ++ impl ::dafny_runtime::DafnyPrint for GetStringInput { ++ fn fmt_print(&self, f: &mut std::fmt::Formatter<'_>, in_seq: bool) -> std::fmt::Result { ++ write!(f, "simple.types.smithystring.internaldafny.types.GetStringInput(value := ")?; ++ self.value().fmt_print(f, false)?; ++ write!(f, ")") ++ } ++ } ++ impl PartialEq for GetStringInput { ++ fn eq(&self, other: &GetStringInput) -> bool { ++ self.value() == other.value() ++ } ++ } ++ impl Eq for GetStringInput {} ++ impl ::core::hash::Hash for GetStringInput { ++ fn hash(&self, state: &mut H) { ++ self.value().hash(state); ++ } ++ } ++ ++ /* ++ datatype GetStringOutput = | GetStringOutput ( ++ nameonly value: Option := Option.None ++ ) */ ++ #[derive(Clone)] ++ pub enum GetStringOutput { ++ GetStringOutput { ++ value: ::std::rc::Rc> ++ } ++ } ++ impl GetStringOutput { ++ pub fn value(&self) -> ::std::rc::Rc> { ++ match self { ++ GetStringOutput::GetStringOutput { value } => { ++ value.clone() ++ } ++ } ++ } ++ } ++ impl ::std::convert::AsRef for &GetStringOutput { ++ fn as_ref(&self) -> Self { ++ self ++ } ++ } ++ impl ::core::fmt::Debug for GetStringOutput { ++ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { ++ ::dafny_runtime::DafnyPrint::fmt_print(self, f, false) ++ } ++ } ++ impl ::dafny_runtime::DafnyPrint for GetStringOutput { ++ fn fmt_print(&self, f: &mut std::fmt::Formatter<'_>, in_seq: bool) -> std::fmt::Result { ++ write!(f, "simple.types.smithystring.internaldafny.types.GetStringOutput(value := ")?; ++ self.value().fmt_print(f, false)?; ++ write!(f, ")") ++ } ++ } ++ impl PartialEq for GetStringOutput { ++ fn eq(&self, other: &GetStringOutput) -> bool { ++ self.value() == other.value() ++ } ++ } ++ impl Eq for GetStringOutput {} ++ impl ::core::hash::Hash for GetStringOutput { ++ fn hash(&self, state: &mut H) { ++ self.value().hash(state); ++ } ++ } ++ ++ ++ /* ++ datatype SimpleStringConfig = | SimpleStringConfig ( ++ ) */ ++ #[derive(Clone)] ++ pub enum SimpleStringConfig { ++ SimpleStringConfig {} ++ } ++ impl ::std::convert::AsRef for &SimpleStringConfig { ++ fn as_ref(&self) -> Self { ++ self ++ } ++ } ++ impl ::core::fmt::Debug for SimpleStringConfig { ++ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { ++ f.debug_struct("SimpleStringConfig").finish() ++ } ++ } ++ impl ::dafny_runtime::DafnyPrint for SimpleStringConfig { ++ fn fmt_print(&self, f: &mut std::fmt::Formatter<'_>, in_seq: bool) -> std::fmt::Result { ++ write!(f, "simple.types.smithystring.internaldafny.types.SimpleStringConfig()") ++ } ++ } ++ impl PartialEq for SimpleStringConfig { ++ fn eq(&self, other: &SimpleStringConfig) -> bool { ++ true ++ } ++ } ++ impl Eq for SimpleStringConfig {} ++ impl ::core::hash::Hash for SimpleStringConfig { ++ fn hash(&self, state: &mut H) { ++ } ++ } ++ ++ pub struct ISimpleTypesStringClientCallHistory { ++ } ++ impl ISimpleTypesStringClientCallHistory { ++ fn ctor(this: *mut ISimpleTypesStringClientCallHistory) { + } + } ++ pub trait ISimpleTypesStringClient { ++ fn GetString(self: &Self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; ++ fn GetStringSingleValue(self: &Self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; ++ fn GetStringUTF8(self: &Self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>>; ++ } ++ /* ++ datatype Error = ++ | CollectionOfErrors(list: seq, nameonly message: string) ++ | Opaque(obj: object) ++ */ ++ #[derive(Clone)] ++ pub enum Error { ++ CollectionOfErrors{list: ::dafny_runtime::Sequence, message: ::dafny_runtime::DafnyStringUTF16}, ++ Opaque{obj: *mut dyn ::std::any::Any} ++ } ++ impl ::core::fmt::Debug for Error { ++ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { ++ match self { ++ Error::CollectionOfErrors{list, message} => f.debug_struct("Error::CollectionOfErrors").field("list", list).field("message", message).finish(), ++ Error::Opaque{obj} => f.debug_struct("Error::Opaque").field("obj", obj).finish() ++ } ++ } ++ } ++ impl ::dafny_runtime::DafnyPrint for Error { ++ fn fmt_print(&self, f: &mut std::fmt::Formatter<'_>, in_seq: bool) -> std::fmt::Result { ++ match self { ++ Error::CollectionOfErrors{list, message} => { ++ write!(f, "Error::CollectionOfErrors(list := ")?; ++ list.fmt_print(f, false)?; ++ write!(f, ", message := ")?; ++ message.fmt_print(f, false)?; ++ write!(f, ")") ++ }, ++ Error::Opaque{obj} => { ++ write!(f, "Error::Opaque(obj := ")?; ++ obj.fmt_print(f, false)?; ++ write!(f, ")") ++ } ++ } ++ } ++ } ++ impl PartialEq for Error { ++ fn eq(&self, other: &Error) -> bool { ++ match self { ++ Error::CollectionOfErrors{list, message} => match other { ++ Error::CollectionOfErrors{list: other_list, message: other_message} => list == other_list && message == other_message, ++ _ => false ++ }, ++ Error::Opaque{obj} => match other { ++ Error::Opaque{obj: other_obj} => obj == other_obj, ++ _ => false ++ } ++ } ++ } ++ } ++ impl Eq for Error {} ++ impl ::core::hash::Hash for Error { ++ fn hash(&self, state: &mut H) { ++ match self { ++ Error::CollectionOfErrors{list, message} => { ++ list.hash(state); ++ message.hash(state); ++ }, ++ Error::Opaque{obj} => obj.hash(state) ++ } ++ } ++ } ++ ++ pub type OpaqueError = Error; ++ ++ ++} ++mod r#_SimpleStringImpl_Compile { ++ pub struct _default {} ++ impl _default { ++ pub fn new() -> Self { ++ _default {} ++ } ++ pub fn _allocated() -> *mut Self { ++ ::dafny_runtime::allocate::() ++ } ++ pub fn GetString(config: &::std::rc::Rc, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>> { ++ let mut output = ::dafny_runtime::MaybePlacebo::<::std::rc::Rc, ::std::rc::Rc>>>::new(); ++ let mut res: ::std::rc::Rc = ::std::rc::Rc::new(super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput::GetStringOutput { ++ value: input.value().clone() ++ }); ++ res = ::std::rc::Rc::new(super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput::GetStringOutput { ++ value: input.value().clone() ++ }); ++ output = ::dafny_runtime::MaybePlacebo::from(::std::rc::Rc::new(super::r#_Wrappers_Compile::Result::<::std::rc::Rc, ::std::rc::Rc>::Success { ++ value: res.clone() ++ })); ++ return output.read(); ++ return output.read(); ++ } ++ pub fn GetStringSingleValue(config: &::std::rc::Rc, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>> { ++ let mut output = ::dafny_runtime::MaybePlacebo::<::std::rc::Rc, ::std::rc::Rc>>>::new(); ++ if !matches!(input.value().as_ref(), super::r#_Wrappers_Compile::Option::Some{ .. }) { ++ panic!("Halt") ++ }; ++ if !(input.value().value().clone() == ::dafny_runtime::string_utf16_of("TEST_SIMPLE_STRING_SINGLE_VALUE")) { ++ panic!("Halt") ++ }; ++ let mut res: ::std::rc::Rc = ::std::rc::Rc::new(super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput::GetStringOutput { ++ value: input.value().clone() ++ }); ++ res = ::std::rc::Rc::new(super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput::GetStringOutput { ++ value: input.value().clone() ++ }); ++ output = ::dafny_runtime::MaybePlacebo::from(::std::rc::Rc::new(super::r#_Wrappers_Compile::Result::<::std::rc::Rc, ::std::rc::Rc>::Success { ++ value: res.clone() ++ })); ++ return output.read(); ++ return output.read(); ++ } ++ pub fn GetStringUTF8(config: &::std::rc::Rc, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>> { ++ let mut output = ::dafny_runtime::MaybePlacebo::<::std::rc::Rc, ::std::rc::Rc>>>::new(); ++ if !matches!(input.value().as_ref(), super::r#_Wrappers_Compile::Option::Some{ .. }) { ++ panic!("Halt") ++ }; ++ let mut res: ::std::rc::Rc = ::std::rc::Rc::new(super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput::GetStringOutput { ++ value: input.value().clone() ++ }); ++ res = ::std::rc::Rc::new(super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput::GetStringOutput { ++ value: input.value().clone() ++ }); ++ output = ::dafny_runtime::MaybePlacebo::from(::std::rc::Rc::new(super::r#_Wrappers_Compile::Result::<::std::rc::Rc, ::std::rc::Rc>::Success { ++ value: res.clone() ++ })); ++ return output.read(); ++ return output.read(); ++ } + } +- impl + Clone + ::dafny_runtime::DafnyPrint + ::std::default::Default + 'static,T1: ::dafny_runtime::DafnyErasable + ::dafny_runtime::DafnyUnerasable + Clone + ::dafny_runtime::DafnyPrint + ::std::default::Default + 'static>::std::default::Default for Tuple2 { ++ impl ::std::default::Default for _default { + fn default() -> Self { +- Tuple2::_T2 { +- _0: ::std::default::Default::default(), +- _1: ::std::default::Default::default() +- } ++ _default::new() + } + } +- #[derive(PartialEq)] +- pub enum Tuple0 { +- _T0 {} ++ impl ::dafny_runtime::DafnyPrint for _default { ++ fn fmt_print(&self, _formatter: &mut ::std::fmt::Formatter, _in_seq: bool) -> std::fmt::Result { ++ write!(_formatter, "SimpleStringImpl_Compile.__default") ++ } + } +- impl Tuple0 {} +- impl ::dafny_runtime::DafnyErasable for Tuple0 { +- type Erased = Tuple0; ++ impl ::std::cmp::PartialEq for _default { ++ fn eq(&self, other: &Self) -> bool { ++ ::std::ptr::eq(self, other) ++ } ++ } ++ #[derive(PartialEq, Clone)] ++ pub enum Config { ++ Config {} + } +- impl ::dafny_runtime::DafnyUnerasable for Tuple0 {} +- impl ::dafny_runtime::DafnyPrint for Tuple0 { ++ impl Config {} ++ impl ::dafny_runtime::DafnyPrint for Config { + fn fmt_print(&self, _formatter: &mut ::std::fmt::Formatter, _in_seq: bool) -> std::fmt::Result { + match self { +- Tuple0::_T0 { } => { +- write!(_formatter, "_System.Tuple0._T0")?; ++ Config::Config { } => { ++ write!(_formatter, "SimpleStringImpl_Compile.Config.Config")?; + Ok(()) + } + } + } + } +- impl ::std::default::Default for Tuple0 { ++ impl ::std::default::Default for Config { ++ fn default() -> Config { ++ Config::Config {} ++ } ++ } ++ impl ::std::convert::AsRef for &Config { ++ fn as_ref(&self) -> Self { ++ self ++ } ++ } ++} ++// SimpleString ++pub mod r#_simple_dtypes_dsmithystring_dinternaldafny { ++ pub struct _default {} ++ impl _default { ++ pub fn new() -> Self { ++ _default {} ++ } ++ pub fn DefaultSimpleStringConfig() -> super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::SimpleStringConfig { ++ super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::SimpleStringConfig::SimpleStringConfig{} ++ } ++ /*method SimpleString(config: SimpleStringConfig) ++ returns (res: Result) { ++ var client := new SimpleStringClient(Operations.Config); ++ return Success(client); ++ } */ ++ pub fn SimpleString(config: &::std::rc::Rc) ++ -> ::std::rc::Rc>> { ++ let client: *mut SimpleStringClient = ::dafny_runtime::allocate::(); ++ SimpleStringClient::_ctor(client, &::std::rc::Rc::new(super::r#_SimpleStringImpl_Compile::Config::Config{})); ++ let v = client as *mut dyn super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::ISimpleTypesStringClient; ++ // build a success ++ ::std::rc::Rc::new(super::r#_Wrappers_Compile::Result::<*mut dyn super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::ISimpleTypesStringClient, ::std::rc::Rc>::Success{ ++ value: v ++ }) ++ } ++ } ++ ++ struct SimpleStringClient { ++ r#_i_config: ::std::rc::Rc ++ } ++ ++ impl SimpleStringClient { ++ fn _ctor(this: *mut SimpleStringClient, config: &::std::rc::Rc) { ++ let mut _i_set_config = false; ++ ::dafny_runtime::update_field_uninit!(this, r#_i_config, _i_set_config, config.clone()); ++ } ++ fn config(&self) -> ::std::rc::Rc { ++ self.r#_i_config.clone() ++ } ++ } ++ impl super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::ISimpleTypesStringClient for SimpleStringClient { ++ fn GetString(self: &Self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>> { ++ super::r#_SimpleStringImpl_Compile::_default::GetString(&self.config(), input) ++ } ++ fn GetStringSingleValue(self: &Self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>> { ++ super::r#_SimpleStringImpl_Compile::_default::GetStringSingleValue(&self.config(), input) ++ } ++ fn GetStringUTF8(self: &Self, input: &::std::rc::Rc) -> ::std::rc::Rc, ::std::rc::Rc>> { ++ super::r#_SimpleStringImpl_Compile::_default::GetStringUTF8(&self.config(), input) ++ } ++ } ++ ::dafny_runtime::UpcastTo!(SimpleStringClient, dyn super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::ISimpleTypesStringClient); ++} ++mod r#_StandardLibraryInterop_Compile { ++ pub struct WrappersInterop {} ++ impl WrappersInterop { ++ pub fn new() -> Self { ++ WrappersInterop {} ++ } ++ pub fn _allocated() -> *mut Self { ++ ::dafny_runtime::allocate::() ++ } ++ pub fn CreateStringSome(s: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>) -> ::std::rc::Rc>> { ++ ::std::rc::Rc::new(super::r#_Wrappers_Compile::Option::<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>::Some { ++ value: s.clone() ++ }) ++ } ++ pub fn CreateStringNone() -> ::std::rc::Rc>> { ++ ::std::rc::Rc::new(super::r#_Wrappers_Compile::Option::<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>::None {}) ++ } ++ pub fn CreateBooleanSome(b: bool) -> ::std::rc::Rc> { ++ ::std::rc::Rc::new(super::r#_Wrappers_Compile::Option::::Some { ++ value: b ++ }) ++ } ++ pub fn CreateBooleanNone() -> ::std::rc::Rc> { ++ ::std::rc::Rc::new(super::r#_Wrappers_Compile::Option::::None {}) ++ } ++ } ++ impl ::std::default::Default for WrappersInterop { + fn default() -> Self { +- Tuple0::_T0 {} ++ WrappersInterop::new() ++ } ++ } ++ impl ::dafny_runtime::DafnyPrint for WrappersInterop { ++ fn fmt_print(&self, _formatter: &mut ::std::fmt::Formatter, _in_seq: bool) -> std::fmt::Result { ++ write!(_formatter, "StandardLibraryInterop_Compile.WrappersInterop") ++ } ++ } ++ impl ::std::cmp::PartialEq for WrappersInterop { ++ fn eq(&self, other: &Self) -> bool { ++ ::std::ptr::eq(self, other) + } + } + } +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client.rs +new file mode 100644 +index 00000000..8416fbdb +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client.rs +@@ -0,0 +1,57 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++ ++use aws_smithy_types::error::operation::BuildError; ++ ++#[derive(Debug)] ++pub(crate) struct Handle { ++ pub(crate) conf: crate::Config, ++ pub(crate) inner: *mut dyn ::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::ISimpleTypesStringClient ++} ++ ++#[derive(::std::clone::Clone, ::std::fmt::Debug)] ++pub struct Client { ++ handle: ::std::sync::Arc, ++} ++ ++impl Client { ++ /// Creates a new client from the service [`Config`](crate::Config). ++ #[track_caller] ++ pub fn from_conf(conf: crate::Config) -> Result { ++ // If this service had any configuration properties, ++ // they would need converting here too. ++ let inner_config = ::std::rc::Rc::new( ++ ::simple_string_dafny::_simple_dtypes_dsmithystring_dinternaldafny::_default::DefaultSimpleStringConfig()); ++ let inner = ++ ::simple_string_dafny::_simple_dtypes_dsmithystring_dinternaldafny::_default::SimpleString(&inner_config); ++ if matches!(inner.as_ref(), ::simple_string_dafny::_Wrappers_Compile::Result::Failure { .. }) { ++ // TODO: convert error - the potential types are not modeled! ++ return Err(BuildError::other(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message("Invalid client config").build())); ++ } ++ let handle = Handle { ++ conf: conf.clone(), ++ inner: inner.Extract() ++ }; ++ Ok(Self { ++ handle: ::std::sync::Arc::new(handle), ++ }) ++ } ++ ++ /// Returns the client's configuration. ++ pub fn config(&self) -> &crate::Config { ++ &self.handle.conf ++ } ++} ++ ++impl Drop for Handle { ++ fn drop(&mut self) { ++ // Ensure the Dafny values we created by calling SimpleString are deallocated. ++ unsafe { drop(Box::from_raw(self.inner)); } ++ } ++} ++ ++mod get_string; ++ ++mod get_string_single_value; ++ ++mod get_string_utf8; ++ +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client/get_string.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client/get_string.rs +new file mode 100644 +index 00000000..ad22d270 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client/get_string.rs +@@ -0,0 +1,13 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++impl super::Client { ++ /// Constructs a fluent builder for the [`GetString`](crate::operation::get_string::builders::GetStringFluentBuilder) operation. ++ /// ++ /// - The fluent builder is configurable: ++ /// - [`value(impl Into>)`](crate::operation::get_string::builders::GetStringFluentBuilder::name) / [`set_name(Option)`](crate::operation::get_string::builders::GetStringFluentBuilder::set_name):(undocumented)
++ /// - On success, responds with [`GetStringOutput`](crate::operation::get_string::GetStringOutput) with field(s): ++ /// - [`value(Option)`](crate::operation::get_string::GetStringOutput::value): (undocumented) ++ /// - On failure, responds with [`SdkError`](crate::operation::get_string::GetStringError) ++ pub fn get_string(&self) -> crate::operation::get_string::builders::GetStringFluentBuilder { ++ crate::operation::get_string::builders::GetStringFluentBuilder::new(self.handle.clone()) ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client/get_string_single_value.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client/get_string_single_value.rs +new file mode 100644 +index 00000000..3c4a6a45 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client/get_string_single_value.rs +@@ -0,0 +1,13 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++impl super::Client { ++ /// Constructs a fluent builder for the [`GetStringSingleValue`](crate::operation::get_string_single_value::builders::GetStringSingleValueFluentBuilder) operation. ++ /// ++ /// - The fluent builder is configurable: ++ /// - [`value(impl Into>)`](crate::operation::get_string_single_value::builders::GetStringSingleValueFluentBuilder::name) / [`set_name(Option)`](crate::operation::get_string_single_value::builders::GetStringSingleValueFluentBuilder::set_name):(undocumented)
++ /// - On success, responds with [`GetStringSingleValueOutput`](crate::operation::get_string_single_value::GetStringSingleValueOutput) with field(s): ++ /// - [`value(Option)`](crate::operation::get_string_single_value::GetStringSingleValueOutput::value): (undocumented) ++ /// - On failure, responds with [`SdkError`](crate::operation::get_string_single_value::GetStringSingleValueError) ++ pub fn get_string_single_value(&self) -> crate::operation::get_string_single_value::builders::GetStringSingleValueFluentBuilder { ++ crate::operation::get_string_single_value::builders::GetStringSingleValueFluentBuilder::new(self.handle.clone()) ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client/get_string_utf8.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client/get_string_utf8.rs +new file mode 100644 +index 00000000..b250b248 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/client/get_string_utf8.rs +@@ -0,0 +1,13 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++impl super::Client { ++ /// Constructs a fluent builder for the [`GetStringUTF8`](crate::operation::get_string_utf8::builders::GetStringUTF8FluentBuilder) operation. ++ /// ++ /// - The fluent builder is configurable: ++ /// - [`value(impl Into>)`](crate::operation::get_string_utf8::builders::GetStringUTF8FluentBuilder::name) / [`set_name(Option)`](crate::operation::get_string_utf8::builders::GetStringUTF8FluentBuilder::set_name):(undocumented)
++ /// - On success, responds with [`GetStringUTF8Output`](crate::operation::get_string_utf8::GetStringUTF8Output) with field(s): ++ /// - [`value(Option)`](crate::operation::get_string_utf8::GetStringUTF8Output::value): (undocumented) ++ /// - On failure, responds with [`SdkError`](crate::operation::get_string_utf8::GetStringUTF8Error) ++ pub fn get_string_utf8(&self) -> crate::operation::get_string_utf8::builders::GetStringUTF8FluentBuilder { ++ crate::operation::get_string_utf8::builders::GetStringUTF8FluentBuilder::new(self.handle.clone()) ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/config.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/config.rs +new file mode 100644 +index 00000000..1cdef04b +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/config.rs +@@ -0,0 +1,125 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++ ++/// Configuration for a simple service client. ++/// ++#[derive(::std::clone::Clone, ::std::fmt::Debug)] ++pub struct Config { ++ behavior_version: ::std::option::Option, ++} ++impl Config { ++ /// Constructs a config builder. ++ pub fn builder() -> Builder { ++ Builder::default() ++ } ++ /// Converts this config back into a builder so that it can be tweaked. ++ pub fn to_builder(&self) -> Builder { ++ Builder { ++ behavior_version: self.behavior_version.clone(), ++ } ++ } ++} ++/// Builder for creating a `Config`. ++#[derive(::std::clone::Clone, ::std::fmt::Debug)] ++pub struct Builder { ++ pub(crate) behavior_version: ::std::option::Option, ++} ++impl ::std::default::Default for Builder { ++ fn default() -> Self { ++ Self { ++ behavior_version: ::std::default::Default::default(), ++ } ++ } ++} ++impl Builder { ++ /// Constructs a config builder. ++ pub fn new() -> Self { ++ Self::default() ++ } ++ ++ /// Sets the [`behavior major version`](crate::config::BehaviorVersion). ++ /// ++ /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards ++ /// compatible. For example, a change which introduces new default timeouts or a new retry-mode for ++ /// all operations might be the ideal behavior but could break existing applications. ++ /// ++ /// # Examples ++ /// ++ /// Set the behavior major version to `latest`. This is equivalent to enabling the `behavior-version-latest` cargo feature. ++ /// ```no_run ++ /// use simple_string::config::BehaviorVersion; ++ /// ++ /// let config = simple_string::Config::builder() ++ /// .behavior_version(BehaviorVersion::latest()) ++ /// // ... ++ /// .build(); ++ /// let client = simple_string::Client::from_conf(config); ++ /// ``` ++ /// ++ /// Customizing behavior major version: ++ /// ```no_run ++ /// use simple_string::config::BehaviorVersion; ++ /// ++ /// let config = simple_string::Config::builder() ++ /// .behavior_version(BehaviorVersion::v2023_11_09()) ++ /// // ... ++ /// .build(); ++ /// let client = simple_string::Client::from_conf(config); ++ /// ``` ++ ++ pub fn behavior_version(mut self, behavior_version: crate::config::BehaviorVersion) -> Self { ++ self.set_behavior_version(Some(behavior_version)); ++ self ++ } ++ ++ /// Sets the [`behavior major version`](crate::config::BehaviorVersion). ++ /// ++ /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards ++ /// compatible. For example, a change which introduces new default timeouts or a new retry-mode for ++ /// all operations might be the ideal behavior but could break existing applications. ++ /// ++ /// # Examples ++ /// ++ /// Set the behavior major version to `latest`. This is equivalent to enabling the `behavior-version-latest` cargo feature. ++ /// ```no_run ++ /// use simple_string::config::BehaviorVersion; ++ /// ++ /// let config = simple_string::Config::builder() ++ /// .behavior_version(BehaviorVersion::latest()) ++ /// // ... ++ /// .build(); ++ /// let client = simple_string::Client::from_conf(config); ++ /// ``` ++ /// ++ /// Customizing behavior major version: ++ /// ```no_run ++ /// use simple_string::config::BehaviorVersion; ++ /// ++ /// let config = simple_string::Config::builder() ++ /// .behavior_version(BehaviorVersion::v2023_11_09()) ++ /// // ... ++ /// .build(); ++ /// let client = simple_string::Client::from_conf(config); ++ /// ``` ++ ++ pub fn set_behavior_version(&mut self, behavior_version: Option) -> &mut Self { ++ self.behavior_version = behavior_version; ++ self ++ } ++ ++ /// Convenience method to set the latest behavior major version ++ /// ++ /// This is equivalent to enabling the `behavior-version-latest` Cargo feature ++ pub fn behavior_version_latest(mut self) -> Self { ++ self.set_behavior_version(Some(crate::config::BehaviorVersion::latest())); ++ self ++ } ++ /// Builds a [`Config`]. ++ #[allow(unused_mut)] ++ pub fn build(mut self) -> Config { ++ Config { ++ behavior_version: self.behavior_version, ++ } ++ } ++} ++ ++pub use ::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion; +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions.rs +new file mode 100644 +index 00000000..7c4b6dcb +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions.rs +@@ -0,0 +1,6 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++pub mod get_string; ++ ++pub mod get_string_single_value; ++ ++pub mod get_string_utf8; +\ No newline at end of file +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string.rs +new file mode 100644 +index 00000000..d3d5b62d +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string.rs +@@ -0,0 +1,26 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++ ++use std::any::Any; ++ ++#[allow(dead_code)] ++pub fn to_dafny_error(value: crate::operation::get_string::GetStringError) -> ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error> { ++ match value { ++ crate::operation::get_string::GetStringError::Unhandled(unhandled) => ++ ::std::rc::Rc::new(::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error::Opaque { obj: Box::into_raw(Box::new(unhandled) as Box) }) ++ } ++} ++ ++#[allow(dead_code)] ++pub fn from_dafny_error(dafny_value: ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error>) -> crate::operation::get_string::GetStringError { ++ // TODO: Losing information here, but we have to figure out how to wrap an arbitrary Dafny value as std::error::Error ++ if matches!(&dafny_value.as_ref(), ::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error::CollectionOfErrors { .. }) { ++ let error_message = "TODO: can't get message yet"; ++ crate::operation::get_string::GetStringError::generic(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message(error_message).build()) ++ } else { ++ crate::operation::get_string::GetStringError::generic(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message("Opaque error").build()) ++ } ++} ++ ++pub mod _get_string_input; ++ ++pub mod _get_string_output; +\ No newline at end of file +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string/_get_string_input.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string/_get_string_input.rs +new file mode 100644 +index 00000000..fac33877 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string/_get_string_input.rs +@@ -0,0 +1,27 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(dead_code)] ++pub fn to_dafny(value: crate::operation::get_string::GetStringInput) -> ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput> { ++ let dafny_value = ++ match value.value { ++ Some(s) => ::simple_string_dafny::_Wrappers_Compile::Option::Some { ++ value: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&s) ++ }, ++ None => ::simple_string_dafny::_Wrappers_Compile::Option::None {}, ++ }; ++ ::std::rc::Rc::new(::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput::GetStringInput { ++ value: ::std::rc::Rc::new(dafny_value) ++ }) ++} ++ ++#[allow(dead_code)] ++pub fn from_dafny(dafny_value: ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput>) -> crate::operation::get_string::GetStringInput { ++ let value = ++ if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::Some { .. }) { ++ Some(dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(&dafny_value.value().Extract())) ++ } else if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::None { .. }) { ++ None ++ } else { ++ panic!("Unreachable") ++ }; ++ crate::operation::get_string::GetStringInput { value } ++} +\ No newline at end of file +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string/_get_string_output.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string/_get_string_output.rs +new file mode 100644 +index 00000000..8fc0dffd +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string/_get_string_output.rs +@@ -0,0 +1,27 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(dead_code)] ++pub fn to_dafny(value: crate::operation::get_string::GetStringOutput) -> ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput> { ++ let dafny_value = ++ match value.value { ++ Some(s) => ::simple_string_dafny::_Wrappers_Compile::Option::Some { ++ value: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&s) ++ }, ++ None => ::simple_string_dafny::_Wrappers_Compile::Option::None {}, ++ }; ++ ::std::rc::Rc::new(::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput::GetStringOutput { ++ value: ::std::rc::Rc::new(dafny_value) ++ }) ++} ++ ++#[allow(dead_code)] ++pub fn from_dafny(dafny_value: ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput>) -> crate::operation::get_string::GetStringOutput { ++ let value = ++ if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::Some { .. }) { ++ Some(dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(&dafny_value.value().Extract())) ++ } else if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::None { .. }) { ++ None ++ } else { ++ panic!("Unreachable") ++ }; ++ crate::operation::get_string::GetStringOutput { value } ++} +\ No newline at end of file +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_single_value.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_single_value.rs +new file mode 100644 +index 00000000..aadbca87 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_single_value.rs +@@ -0,0 +1,26 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++ ++use std::any::Any; ++ ++#[allow(dead_code)] ++pub fn to_dafny_error(value: crate::operation::get_string_single_value::GetStringSingleValueError) -> ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error> { ++ match value { ++ crate::operation::get_string_single_value::GetStringSingleValueError::Unhandled(unhandled) => ++ ::std::rc::Rc::new(::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error::Opaque { obj: Box::into_raw(Box::new(unhandled) as Box) }) ++ } ++} ++ ++#[allow(dead_code)] ++pub fn from_dafny_error(dafny_value: ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error>) -> crate::operation::get_string_single_value::GetStringSingleValueError { ++ // TODO: Losing information here, but we have to figure out how to wrap an arbitrary Dafny value as std::error::Error ++ if matches!(&dafny_value.as_ref(), ::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error::CollectionOfErrors { .. }) { ++ let error_message = "TODO: can't get message yet"; ++ crate::operation::get_string_single_value::GetStringSingleValueError::generic(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message(error_message).build()) ++ } else { ++ crate::operation::get_string_single_value::GetStringSingleValueError::generic(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message("Opaque error").build()) ++ } ++} ++ ++pub mod _get_string_single_value_input; ++ ++pub mod _get_string_single_value_output; +\ No newline at end of file +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_single_value/_get_string_single_value_input.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_single_value/_get_string_single_value_input.rs +new file mode 100644 +index 00000000..25b28588 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_single_value/_get_string_single_value_input.rs +@@ -0,0 +1,27 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(dead_code)] ++pub fn to_dafny(value: crate::operation::get_string_single_value::GetStringSingleValueInput) -> ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput> { ++ let dafny_value = ++ match value.value { ++ Some(s) => ::simple_string_dafny::_Wrappers_Compile::Option::Some { ++ value: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&s) ++ }, ++ None => ::simple_string_dafny::_Wrappers_Compile::Option::None {}, ++ }; ++ ::std::rc::Rc::new(::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput::GetStringInput { ++ value: ::std::rc::Rc::new(dafny_value) ++ }) ++} ++ ++#[allow(dead_code)] ++pub fn from_dafny(dafny_value: ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput>) -> crate::operation::get_string_single_value::GetStringSingleValueInput { ++ let value = ++ if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::Some { .. }) { ++ Some(dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(&dafny_value.value().Extract())) ++ } else if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::None { .. }) { ++ None ++ } else { ++ panic!("Unreachable") ++ }; ++ crate::operation::get_string_single_value::GetStringSingleValueInput { value } ++} +\ No newline at end of file +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_single_value/_get_string_single_value_output.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_single_value/_get_string_single_value_output.rs +new file mode 100644 +index 00000000..4e0358c6 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_single_value/_get_string_single_value_output.rs +@@ -0,0 +1,27 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(dead_code)] ++pub fn to_dafny(value: crate::operation::get_string_single_value::GetStringSingleValueOutput) -> ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput> { ++ let dafny_value = ++ match value.value { ++ Some(s) => ::simple_string_dafny::_Wrappers_Compile::Option::Some { ++ value: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&s) ++ }, ++ None => ::simple_string_dafny::_Wrappers_Compile::Option::None {}, ++ }; ++ ::std::rc::Rc::new(::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput::GetStringOutput { ++ value: ::std::rc::Rc::new(dafny_value) ++ }) ++} ++ ++#[allow(dead_code)] ++pub fn from_dafny(dafny_value: ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput>) -> crate::operation::get_string_single_value::GetStringSingleValueOutput { ++ let value = ++ if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::Some { .. }) { ++ Some(dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(&dafny_value.value().Extract())) ++ } else if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::None { .. }) { ++ None ++ } else { ++ panic!("Unreachable") ++ }; ++ crate::operation::get_string_single_value::GetStringSingleValueOutput { value } ++} +\ No newline at end of file +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_utf8.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_utf8.rs +new file mode 100644 +index 00000000..a9eacc81 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_utf8.rs +@@ -0,0 +1,26 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++ ++use std::any::Any; ++ ++#[allow(dead_code)] ++pub fn to_dafny_error(value: crate::operation::get_string_utf8::GetStringUTF8Error) -> ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error> { ++ match value { ++ crate::operation::get_string_utf8::GetStringUTF8Error::Unhandled(unhandled) => ++ ::std::rc::Rc::new(::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error::Opaque { obj: Box::into_raw(Box::new(unhandled) as Box) }) ++ } ++} ++ ++#[allow(dead_code)] ++pub fn from_dafny_error(dafny_value: ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error>) -> crate::operation::get_string_utf8::GetStringUTF8Error { ++ // TODO: Losing information here, but we have to figure out how to wrap an arbitrary Dafny value as std::error::Error ++ if matches!(&dafny_value.as_ref(), ::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error::CollectionOfErrors { .. }) { ++ let error_message = "TODO: can't get message yet"; ++ crate::operation::get_string_utf8::GetStringUTF8Error::generic(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message(error_message).build()) ++ } else { ++ crate::operation::get_string_utf8::GetStringUTF8Error::generic(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message("Opaque error").build()) ++ } ++} ++ ++pub mod _get_string_utf8_input; ++ ++pub mod _get_string_utf8_output; +\ No newline at end of file +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_utf8/_get_string_utf8_input.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_utf8/_get_string_utf8_input.rs +new file mode 100644 +index 00000000..7e9a2595 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_utf8/_get_string_utf8_input.rs +@@ -0,0 +1,27 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(dead_code)] ++pub fn to_dafny(value: crate::operation::get_string_utf8::GetStringUTF8Input) -> ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput> { ++ let dafny_value = ++ match value.value { ++ Some(s) => ::simple_string_dafny::_Wrappers_Compile::Option::Some { ++ value: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&s) ++ }, ++ None => ::simple_string_dafny::_Wrappers_Compile::Option::None {}, ++ }; ++ ::std::rc::Rc::new(::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput::GetStringInput { ++ value: ::std::rc::Rc::new(dafny_value) ++ }) ++} ++ ++#[allow(dead_code)] ++pub fn from_dafny(dafny_value: ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput>) -> crate::operation::get_string_utf8::GetStringUTF8Input { ++ let value = ++ if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::Some { .. }) { ++ Some(dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(&dafny_value.value().Extract())) ++ } else if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::None { .. }) { ++ None ++ } else { ++ panic!("Unreachable") ++ }; ++ crate::operation::get_string_utf8::GetStringUTF8Input { value } ++} +\ No newline at end of file +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_utf8/_get_string_utf8_output.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_utf8/_get_string_utf8_output.rs +new file mode 100644 +index 00000000..4656bc2d +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/conversions/get_string_utf8/_get_string_utf8_output.rs +@@ -0,0 +1,27 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(dead_code)] ++pub fn to_dafny(value: crate::operation::get_string_utf8::GetStringUTF8Output) -> ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput> { ++ let dafny_value = ++ match value.value { ++ Some(s) => ::simple_string_dafny::_Wrappers_Compile::Option::Some { ++ value: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&s) ++ }, ++ None => ::simple_string_dafny::_Wrappers_Compile::Option::None {}, ++ }; ++ ::std::rc::Rc::new(::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput::GetStringOutput { ++ value: ::std::rc::Rc::new(dafny_value) ++ }) ++} ++ ++#[allow(dead_code)] ++pub fn from_dafny(dafny_value: ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput>) -> crate::operation::get_string_utf8::GetStringUTF8Output { ++ let value = ++ if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::Some { .. }) { ++ Some(dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(&dafny_value.value().Extract())) ++ } else if matches!(dafny_value.value().as_ref(), ::simple_string_dafny::_Wrappers_Compile::Option::None { .. }) { ++ None ++ } else { ++ panic!("Unreachable") ++ }; ++ crate::operation::get_string_utf8::GetStringUTF8Output { value } ++} +\ No newline at end of file +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/error.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/error.rs +new file mode 100644 +index 00000000..f2646b97 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/error.rs +@@ -0,0 +1,13 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++pub use ::aws_smithy_runtime_api::box_error::BoxError; ++ ++/// Error type returned by the client. ++pub type SdkError = ::aws_smithy_runtime_api::client::result::SdkError; ++pub use ::aws_smithy_runtime_api::client::result::ConnectorError; ++pub use ::aws_smithy_types::error::operation::BuildError; ++ ++pub use ::aws_smithy_types::error::display::DisplayErrorContext; ++pub use ::aws_smithy_types::error::metadata::ErrorMetadata; ++pub use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; ++ ++pub(crate) mod sealed_unhandled; +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/error/sealed_unhandled.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/error/sealed_unhandled.rs +new file mode 100644 +index 00000000..357c3ccc +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/error/sealed_unhandled.rs +@@ -0,0 +1,20 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++/// This struct is not intended to be used. ++/// ++/// This struct holds information about an unhandled error, ++/// but that information should be obtained by using the ++/// [`ProvideErrorMetadata`](::aws_smithy_types::error::metadata::ProvideErrorMetadata) trait ++/// on the error type. ++/// ++/// This struct intentionally doesn't yield any useful information itself. ++#[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ ++variable wildcard pattern and check `.code()`: ++ \ ++   `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` ++ \ ++See [`ProvideErrorMetadata`](::aws_smithy_types::error::metadata::ProvideErrorMetadata) for what information is available for the error.")] ++#[derive(Debug)] ++pub struct Unhandled { ++ pub(crate) source: ::aws_smithy_runtime_api::box_error::BoxError, ++ pub(crate) meta: ::aws_smithy_types::error::metadata::ErrorMetadata, ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/lib.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/lib.rs +new file mode 100644 +index 00000000..626baa2d +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/lib.rs +@@ -0,0 +1,20 @@ ++ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++ ++#[doc(inline)] ++pub use config::Config; ++ ++pub mod client; ++ ++/// Configuration for SimpleString Service. ++pub mod config; ++ ++/// Common errors and error handling utilities. ++pub mod error; ++ ++/// All operations that this crate can perform. ++pub mod operation; ++ ++mod conversions; ++ ++pub use client::Client; +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation.rs +new file mode 100644 +index 00000000..668f909e +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation.rs +@@ -0,0 +1,10 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++ ++/// Types for the `GetString` operation. ++pub mod get_string; ++ ++/// Types for the `GetStringSingleValue` operation. ++pub mod get_string_single_value; ++ ++/// Types for the `GetStringUTF8` operation. ++pub mod get_string_utf8; +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string.rs +new file mode 100644 +index 00000000..92b4a01c +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string.rs +@@ -0,0 +1,127 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++/// Orchestration and serialization glue logic for `GetString`. ++#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] ++#[non_exhaustive] ++pub struct GetString; ++impl GetString { ++ /// Creates a new `GetString` ++ pub fn new() -> Self { ++ Self ++ } ++ pub(crate) async fn send( ++ handle: &crate::client::Handle, ++ input: crate::operation::get_string::GetStringInput, ++ ) -> ::std::result::Result< ++ crate::operation::get_string::GetStringOutput, ++ crate::operation::get_string::GetStringError ++ > { ++ let inner_input = crate::conversions::get_string::_get_string_input::to_dafny(input); ++ let inner_result = ::simple_string_dafny::dafny_runtime::read!(handle.inner).GetString(&inner_input); ++ if matches!(inner_result.as_ref(), ::simple_string_dafny::r#_Wrappers_Compile::Result::Success{ .. }) { ++ Ok(crate::conversions::get_string::_get_string_output::from_dafny(inner_result.value().clone())) ++ } else { ++ Err(crate::conversions::get_string::from_dafny_error(inner_result.error().clone())) ++ } ++ } ++} ++ ++/// Error type for the `GetString` operation. ++#[non_exhaustive] ++#[derive(::std::fmt::Debug)] ++pub enum GetStringError { ++ /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). ++ #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ ++ variable wildcard pattern and check `.code()`: ++ \ ++    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` ++ \ ++ See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetStringError) for what information is available for the error.")] ++ Unhandled(crate::error::sealed_unhandled::Unhandled), ++} ++impl GetStringError { ++ /// Creates the `GetStringError::Unhandled` variant from any error type. ++ pub fn unhandled( ++ err: impl ::std::convert::Into<::std::boxed::Box>, ++ ) -> Self { ++ Self::Unhandled(crate::error::sealed_unhandled::Unhandled { ++ source: err.into(), ++ meta: ::std::default::Default::default(), ++ }) ++ } ++ ++ /// Creates the `GetStringError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). ++ pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { ++ Self::Unhandled(crate::error::sealed_unhandled::Unhandled { ++ source: err.clone().into(), ++ meta: err, ++ }) ++ } ++ /// ++ /// Returns error metadata, which includes the error code, message, ++ /// request ID, and potentially additional information. ++ /// ++ pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { ++ match self { ++ Self::Unhandled(e) => &e.meta, ++ } ++ } ++} ++impl ::std::error::Error for GetStringError { ++ fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { ++ match self { ++ Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), ++ } ++ } ++} ++impl ::std::fmt::Display for GetStringError { ++ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ++ match self { ++ Self::Unhandled(_inner) => { ++ if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { ++ write!(f, "unhandled error ({code})") ++ } else { ++ f.write_str("unhandled error") ++ } ++ } ++ } ++ } ++} ++impl ::aws_smithy_types::retry::ProvideErrorKind for GetStringError { ++ fn code(&self) -> ::std::option::Option<&str> { ++ ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) ++ } ++ fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { ++ ::std::option::Option::None ++ } ++} ++impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetStringError { ++ fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { ++ match self { ++ Self::Unhandled(_inner) => &_inner.meta, ++ } ++ } ++} ++impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetStringError { ++ fn create_unhandled_error( ++ source: ::std::boxed::Box, ++ meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, ++ ) -> Self { ++ Self::Unhandled(crate::error::sealed_unhandled::Unhandled { ++ source, ++ meta: meta.unwrap_or_default(), ++ }) ++ } ++} ++ ++use core::panic; ++ ++pub use crate::operation::get_string::_get_string_output::GetStringOutput; ++ ++pub use crate::operation::get_string::_get_string_input::GetStringInput; ++ ++mod _get_string_input; ++ ++mod _get_string_output; ++ ++/// Builders ++pub mod builders; +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string/_get_string_input.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string/_get_string_input.rs +new file mode 100644 +index 00000000..6b6defd1 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string/_get_string_input.rs +@@ -0,0 +1,47 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(missing_docs)] // documentation missing in model ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] ++pub struct GetStringInput { ++ #[allow(missing_docs)] // documentation missing in model ++ pub value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringInput { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn message(&self) -> ::std::option::Option<&str> { ++ self.value.as_deref() ++ } ++} ++impl GetStringInput { ++ /// Creates a new builder-style object to manufacture [`GetStringInput`](crate::operation::operation::GetStringInput). ++ pub fn builder() -> crate::operation::get_string::builders::GetStringInputBuilder { ++ crate::operation::get_string::builders::GetStringInputBuilder::default() ++ } ++} ++ ++/// A builder for [`GetStringInput`](crate::operation::operation::GetStringInput). ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] ++pub struct GetStringInputBuilder { ++ pub(crate) value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringInputBuilder { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { ++ self.value = ::std::option::Option::Some(input.into()); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { ++ self.value = input; ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { ++ &self.value ++ } ++ /// Consumes the builder and constructs a [`GetStringInput`](crate::operation::operation::GetStringInput). ++ pub fn build(self) -> ::std::result::Result { ++ ::std::result::Result::Ok(crate::operation::get_string::GetStringInput { value: self.value }) ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string/_get_string_output.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string/_get_string_output.rs +new file mode 100644 +index 00000000..6bcd74c0 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string/_get_string_output.rs +@@ -0,0 +1,47 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(missing_docs)] // documentation missing in model ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] ++pub struct GetStringOutput { ++ #[allow(missing_docs)] // documentation missing in model ++ pub value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringOutput { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(&self) -> ::std::option::Option<&str> { ++ self.value.as_deref() ++ } ++} ++impl GetStringOutput { ++ /// Creates a new builder-style object to manufacture [`GetStringOutput`](crate::operation::operation::GetStringOutput). ++ pub fn builder() -> crate::operation::get_string::builders::GetStringOutputBuilder { ++ crate::operation::get_string::builders::GetStringOutputBuilder::default() ++ } ++} ++ ++/// A builder for [`GetStringOutput`](crate::operation::operation::GetStringOutput). ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] ++pub struct GetStringOutputBuilder { ++ pub(crate) value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringOutputBuilder { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { ++ self.value = ::std::option::Option::Some(input.into()); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { ++ self.value = input; ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { ++ &self.value ++ } ++ /// Consumes the builder and constructs a [`GetStringOutput`](crate::operation::operation::GetStringOutput). ++ pub fn build(self) -> ::std::result::Result { ++ ::std::result::Result::Ok(crate::operation::get_string::GetStringOutput { value: self.value }) ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string/builders.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string/builders.rs +new file mode 100644 +index 00000000..691f2645 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string/builders.rs +@@ -0,0 +1,83 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++pub use crate::operation::get_string::_get_string_output::GetStringOutputBuilder; ++ ++pub use crate::operation::get_string::_get_string_input::GetStringInputBuilder; ++ ++impl GetStringInputBuilder { ++ /// Sends a request with this input using the given client. ++ pub async fn send_with( ++ self, ++ client: &crate::Client, ++ ) -> ::std::result::Result< ++ crate::operation::get_string::GetStringOutput, ++ crate::operation::get_string::GetStringError ++ > { ++ let mut fluent_builder = client.get_string(); ++ fluent_builder.inner = self; ++ fluent_builder.send().await ++ } ++} ++/// Fluent builder constructing a request to `GetString`. ++/// ++#[derive(::std::clone::Clone, ::std::fmt::Debug)] ++pub struct GetStringFluentBuilder { ++ handle: ::std::sync::Arc, ++ inner: crate::operation::get_string::builders::GetStringInputBuilder, ++ config_override: ::std::option::Option, ++} ++impl GetStringFluentBuilder { ++ /// Creates a new `GetString`. ++ pub(crate) fn new(handle: ::std::sync::Arc) -> Self { ++ Self { ++ handle, ++ inner: ::std::default::Default::default(), ++ config_override: ::std::option::Option::None, ++ } ++ } ++ /// Access the GetString as a reference. ++ pub fn as_input(&self) -> &crate::operation::get_string::builders::GetStringInputBuilder { ++ &self.inner ++ } ++ /// Sends the request and returns the response. ++ pub async fn send( ++ self, ++ ) -> ::std::result::Result< ++ crate::operation::get_string::GetStringOutput, ++ crate::operation::get_string::GetStringError ++ > { ++ let input = self ++ .inner ++ .build() ++ // Using unhandled since GetString doesn't declare any validation, ++ // and smithy-rs seems to not generate a ValidationError case unless there is ++ // (but isn't that a backwards compatibility problem for output structures?) ++ // Vanilla smithy-rs uses SdkError::construction_failure, ++ // but we aren't using SdkError. ++ .map_err(crate::operation::get_string::GetStringError::unhandled)?; ++ crate::operation::get_string::GetString::send(&self.handle, input).await ++ } ++ ++ pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { ++ self.set_config_override(Some(config_override.into())); ++ self ++ } ++ ++ pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { ++ self.config_override = config_override; ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { ++ self.inner = self.inner.value(input.into()); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { ++ self.inner = self.inner.set_value(input); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { ++ self.inner.get_value() ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value.rs +new file mode 100644 +index 00000000..d894f22f +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value.rs +@@ -0,0 +1,127 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++/// Orchestration and serialization glue logic for `GetStringSingleValue`. ++#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] ++#[non_exhaustive] ++pub struct GetStringSingleValue; ++impl GetStringSingleValue { ++ /// Creates a new `GetStringSingleValue` ++ pub fn new() -> Self { ++ Self ++ } ++ pub(crate) async fn send( ++ handle: &crate::client::Handle, ++ input: crate::operation::get_string_single_value::GetStringSingleValueInput, ++ ) -> ::std::result::Result< ++ crate::operation::get_string_single_value::GetStringSingleValueOutput, ++ crate::operation::get_string_single_value::GetStringSingleValueError ++ > { ++ let inner_input = crate::conversions::get_string_single_value::_get_string_single_value_input::to_dafny(input); ++ let inner_result = ::simple_string_dafny::dafny_runtime::read!(handle.inner).GetStringUTF8(&inner_input); ++ if matches!(inner_result.as_ref(), ::simple_string_dafny::r#_Wrappers_Compile::Result::Success{ .. }) { ++ Ok(crate::conversions::get_string_single_value::_get_string_single_value_output::from_dafny(inner_result.value().clone())) ++ } else { ++ Err(crate::conversions::get_string_single_value::from_dafny_error(inner_result.error().clone())) ++ } ++ } ++} ++ ++/// Error type for the `GetStringSingleValue` operation. ++#[non_exhaustive] ++#[derive(::std::fmt::Debug)] ++pub enum GetStringSingleValueError { ++ /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). ++ #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ ++ variable wildcard pattern and check `.code()`: ++ \ ++    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` ++ \ ++ See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetStringSingleValueError) for what information is available for the error.")] ++ Unhandled(crate::error::sealed_unhandled::Unhandled), ++} ++impl GetStringSingleValueError { ++ /// Creates the `GetStringSingleValueError::Unhandled` variant from any error type. ++ pub fn unhandled( ++ err: impl ::std::convert::Into<::std::boxed::Box>, ++ ) -> Self { ++ Self::Unhandled(crate::error::sealed_unhandled::Unhandled { ++ source: err.into(), ++ meta: ::std::default::Default::default(), ++ }) ++ } ++ ++ /// Creates the `GetStringSingleValueError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). ++ pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { ++ Self::Unhandled(crate::error::sealed_unhandled::Unhandled { ++ source: err.clone().into(), ++ meta: err, ++ }) ++ } ++ /// ++ /// Returns error metadata, which includes the error code, message, ++ /// request ID, and potentially additional information. ++ /// ++ pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { ++ match self { ++ Self::Unhandled(e) => &e.meta, ++ } ++ } ++} ++impl ::std::error::Error for GetStringSingleValueError { ++ fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { ++ match self { ++ Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), ++ } ++ } ++} ++impl ::std::fmt::Display for GetStringSingleValueError { ++ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ++ match self { ++ Self::Unhandled(_inner) => { ++ if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { ++ write!(f, "unhandled error ({code})") ++ } else { ++ f.write_str("unhandled error") ++ } ++ } ++ } ++ } ++} ++impl ::aws_smithy_types::retry::ProvideErrorKind for GetStringSingleValueError { ++ fn code(&self) -> ::std::option::Option<&str> { ++ ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) ++ } ++ fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { ++ ::std::option::Option::None ++ } ++} ++impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetStringSingleValueError { ++ fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { ++ match self { ++ Self::Unhandled(_inner) => &_inner.meta, ++ } ++ } ++} ++impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetStringSingleValueError { ++ fn create_unhandled_error( ++ source: ::std::boxed::Box, ++ meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, ++ ) -> Self { ++ Self::Unhandled(crate::error::sealed_unhandled::Unhandled { ++ source, ++ meta: meta.unwrap_or_default(), ++ }) ++ } ++} ++ ++use core::panic; ++ ++pub use crate::operation::get_string_single_value::_get_string_single_value_output::GetStringSingleValueOutput; ++ ++pub use crate::operation::get_string_single_value::_get_string_single_value_input::GetStringSingleValueInput; ++ ++mod _get_string_single_value_input; ++ ++mod _get_string_single_value_output; ++ ++/// Builders ++pub mod builders; +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value/_get_string_single_value_input.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value/_get_string_single_value_input.rs +new file mode 100644 +index 00000000..39a3dbf7 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value/_get_string_single_value_input.rs +@@ -0,0 +1,47 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(missing_docs)] // documentation missing in model ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] ++pub struct GetStringSingleValueInput { ++ #[allow(missing_docs)] // documentation missing in model ++ pub value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringSingleValueInput { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(&self) -> ::std::option::Option<&str> { ++ self.value.as_deref() ++ } ++} ++impl GetStringSingleValueInput { ++ /// Creates a new builder-style object to manufacture [`GetStringSingleValueInput`](crate::operation::operation::GetStringSingleValueInput). ++ pub fn builder() -> crate::operation::get_string_single_value::builders::GetStringSingleValueInputBuilder { ++ crate::operation::get_string_single_value::builders::GetStringSingleValueInputBuilder::default() ++ } ++} ++ ++/// A builder for [`GetStringSingleValueInput`](crate::operation::operation::GetStringSingleValueInput). ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] ++pub struct GetStringSingleValueInputBuilder { ++ pub(crate) value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringSingleValueInputBuilder { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { ++ self.value = ::std::option::Option::Some(input.into()); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { ++ self.value = input; ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { ++ &self.value ++ } ++ /// Consumes the builder and constructs a [`GetStringSingleValueInput`](crate::operation::operation::GetStringSingleValueInput). ++ pub fn build(self) -> ::std::result::Result { ++ ::std::result::Result::Ok(crate::operation::get_string_single_value::GetStringSingleValueInput { value: self.value }) ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value/_get_string_single_value_output.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value/_get_string_single_value_output.rs +new file mode 100644 +index 00000000..c6139f5b +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value/_get_string_single_value_output.rs +@@ -0,0 +1,47 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(missing_docs)] // documentation missing in model ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] ++pub struct GetStringSingleValueOutput { ++ #[allow(missing_docs)] // documentation missing in model ++ pub value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringSingleValueOutput { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(&self) -> ::std::option::Option<&str> { ++ self.value.as_deref() ++ } ++} ++impl GetStringSingleValueOutput { ++ /// Creates a new builder-style object to manufacture [`GetStringSingleValueOutput`](crate::operation::operation::GetStringSingleValueOutput). ++ pub fn builder() -> crate::operation::get_string_single_value::builders::GetStringSingleValueOutputBuilder { ++ crate::operation::get_string_single_value::builders::GetStringSingleValueOutputBuilder::default() ++ } ++} ++ ++/// A builder for [`GetStringSingleValueOutput`](crate::operation::operation::GetStringSingleValueOutput). ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] ++pub struct GetStringSingleValueOutputBuilder { ++ pub(crate) value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringSingleValueOutputBuilder { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { ++ self.value = ::std::option::Option::Some(input.into()); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { ++ self.value = input; ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { ++ &self.value ++ } ++ /// Consumes the builder and constructs a [`GetStringSingleValueOutput`](crate::operation::operation::GetStringSingleValueOutput). ++ pub fn build(self) -> ::std::result::Result { ++ ::std::result::Result::Ok(crate::operation::get_string_single_value::GetStringSingleValueOutput { value: self.value }) ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value/builders.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value/builders.rs +new file mode 100644 +index 00000000..03c86742 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_single_value/builders.rs +@@ -0,0 +1,83 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++pub use crate::operation::get_string_single_value::_get_string_single_value_output::GetStringSingleValueOutputBuilder; ++ ++pub use crate::operation::get_string_single_value::_get_string_single_value_input::GetStringSingleValueInputBuilder; ++ ++impl GetStringSingleValueInputBuilder { ++ /// Sends a request with this input using the given client. ++ pub async fn send_with( ++ self, ++ client: &crate::Client, ++ ) -> ::std::result::Result< ++ crate::operation::get_string_single_value::GetStringSingleValueOutput, ++ crate::operation::get_string_single_value::GetStringSingleValueError ++ > { ++ let mut fluent_builder = client.get_string_single_value(); ++ fluent_builder.inner = self; ++ fluent_builder.send().await ++ } ++} ++/// Fluent builder constructing a request to `GetStringSingleValue`. ++/// ++#[derive(::std::clone::Clone, ::std::fmt::Debug)] ++pub struct GetStringSingleValueFluentBuilder { ++ handle: ::std::sync::Arc, ++ inner: crate::operation::get_string_single_value::builders::GetStringSingleValueInputBuilder, ++ config_override: ::std::option::Option, ++} ++impl GetStringSingleValueFluentBuilder { ++ /// Creates a new `GetStringSingleValue`. ++ pub(crate) fn new(handle: ::std::sync::Arc) -> Self { ++ Self { ++ handle, ++ inner: ::std::default::Default::default(), ++ config_override: ::std::option::Option::None, ++ } ++ } ++ /// Access the GetStringSingleValue as a reference. ++ pub fn as_input(&self) -> &crate::operation::get_string_single_value::builders::GetStringSingleValueInputBuilder { ++ &self.inner ++ } ++ /// Sends the request and returns the response. ++ pub async fn send( ++ self, ++ ) -> ::std::result::Result< ++ crate::operation::get_string_single_value::GetStringSingleValueOutput, ++ crate::operation::get_string_single_value::GetStringSingleValueError ++ > { ++ let input = self ++ .inner ++ .build() ++ // Using unhandled since GetString doesn't declare any validation, ++ // and smithy-rs seems to not generate a ValidationError case unless there is ++ // (but isn't that a backwards compatibility problem for output structures?) ++ // Vanilla smithy-rs uses SdkError::construction_failure, ++ // but we aren't using SdkError. ++ .map_err(crate::operation::get_string_single_value::GetStringSingleValueError::unhandled)?; ++ crate::operation::get_string_single_value::GetStringSingleValue::send(&self.handle, input).await ++ } ++ ++ pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { ++ self.set_config_override(Some(config_override.into())); ++ self ++ } ++ ++ pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { ++ self.config_override = config_override; ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { ++ self.inner = self.inner.value(input.into()); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { ++ self.inner = self.inner.set_value(input); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { ++ self.inner.get_value() ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8.rs +new file mode 100644 +index 00000000..eb255979 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8.rs +@@ -0,0 +1,127 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++/// Orchestration and serialization glue logic for `GetStringUTF8`. ++#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] ++#[non_exhaustive] ++pub struct GetStringUTF8; ++impl GetStringUTF8 { ++ /// Creates a new `GetStringUTF8` ++ pub fn new() -> Self { ++ Self ++ } ++ pub(crate) async fn send( ++ handle: &crate::client::Handle, ++ input: crate::operation::get_string_utf8::GetStringUTF8Input, ++ ) -> ::std::result::Result< ++ crate::operation::get_string_utf8::GetStringUTF8Output, ++ crate::operation::get_string_utf8::GetStringUTF8Error ++ > { ++ let inner_input = crate::conversions::get_string_utf8::_get_string_utf8_input::to_dafny(input); ++ let inner_result = ::simple_string_dafny::dafny_runtime::read!(handle.inner).GetStringUTF8(&inner_input); ++ if matches!(inner_result.as_ref(), ::simple_string_dafny::r#_Wrappers_Compile::Result::Success{ .. }) { ++ Ok(crate::conversions::get_string_utf8::_get_string_utf8_output::from_dafny(inner_result.value().clone())) ++ } else { ++ Err(crate::conversions::get_string_utf8::from_dafny_error(inner_result.error().clone())) ++ } ++ } ++} ++ ++/// Error type for the `GetStringUTF8` operation. ++#[non_exhaustive] ++#[derive(::std::fmt::Debug)] ++pub enum GetStringUTF8Error { ++ /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). ++ #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ ++ variable wildcard pattern and check `.code()`: ++ \ ++    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` ++ \ ++ See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetStringUTF8Error) for what information is available for the error.")] ++ Unhandled(crate::error::sealed_unhandled::Unhandled), ++} ++impl GetStringUTF8Error { ++ /// Creates the `GetStringUTF8Error::Unhandled` variant from any error type. ++ pub fn unhandled( ++ err: impl ::std::convert::Into<::std::boxed::Box>, ++ ) -> Self { ++ Self::Unhandled(crate::error::sealed_unhandled::Unhandled { ++ source: err.into(), ++ meta: ::std::default::Default::default(), ++ }) ++ } ++ ++ /// Creates the `GetStringUTF8Error::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). ++ pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { ++ Self::Unhandled(crate::error::sealed_unhandled::Unhandled { ++ source: err.clone().into(), ++ meta: err, ++ }) ++ } ++ /// ++ /// Returns error metadata, which includes the error code, message, ++ /// request ID, and potentially additional information. ++ /// ++ pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { ++ match self { ++ Self::Unhandled(e) => &e.meta, ++ } ++ } ++} ++impl ::std::error::Error for GetStringUTF8Error { ++ fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { ++ match self { ++ Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), ++ } ++ } ++} ++impl ::std::fmt::Display for GetStringUTF8Error { ++ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ++ match self { ++ Self::Unhandled(_inner) => { ++ if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { ++ write!(f, "unhandled error ({code})") ++ } else { ++ f.write_str("unhandled error") ++ } ++ } ++ } ++ } ++} ++impl ::aws_smithy_types::retry::ProvideErrorKind for GetStringUTF8Error { ++ fn code(&self) -> ::std::option::Option<&str> { ++ ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) ++ } ++ fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { ++ ::std::option::Option::None ++ } ++} ++impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetStringUTF8Error { ++ fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { ++ match self { ++ Self::Unhandled(_inner) => &_inner.meta, ++ } ++ } ++} ++impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetStringUTF8Error { ++ fn create_unhandled_error( ++ source: ::std::boxed::Box, ++ meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, ++ ) -> Self { ++ Self::Unhandled(crate::error::sealed_unhandled::Unhandled { ++ source, ++ meta: meta.unwrap_or_default(), ++ }) ++ } ++} ++ ++use core::panic; ++ ++pub use crate::operation::get_string_utf8::_get_string_utf8_output::GetStringUTF8Output; ++ ++pub use crate::operation::get_string_utf8::_get_string_utf8_input::GetStringUTF8Input; ++ ++mod _get_string_utf8_input; ++ ++mod _get_string_utf8_output; ++ ++/// Builders ++pub mod builders; +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8/_get_string_utf8_input.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8/_get_string_utf8_input.rs +new file mode 100644 +index 00000000..508b4e80 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8/_get_string_utf8_input.rs +@@ -0,0 +1,47 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(missing_docs)] // documentation missing in model ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] ++pub struct GetStringUTF8Input { ++ #[allow(missing_docs)] // documentation missing in model ++ pub value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringUTF8Input { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(&self) -> ::std::option::Option<&str> { ++ self.value.as_deref() ++ } ++} ++impl GetStringUTF8Input { ++ /// Creates a new builder-style object to manufacture [`GetStringUTF8Input`](crate::operation::operation::GetStringUTF8Input). ++ pub fn builder() -> crate::operation::get_string_utf8::builders::GetStringUTF8InputBuilder { ++ crate::operation::get_string_utf8::builders::GetStringUTF8InputBuilder::default() ++ } ++} ++ ++/// A builder for [`GetStringUTF8Input`](crate::operation::operation::GetStringUTF8Input). ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] ++pub struct GetStringUTF8InputBuilder { ++ pub(crate) value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringUTF8InputBuilder { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { ++ self.value = ::std::option::Option::Some(input.into()); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { ++ self.value = input; ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { ++ &self.value ++ } ++ /// Consumes the builder and constructs a [`GetStringUTF8Input`](crate::operation::operation::GetStringUTF8Input). ++ pub fn build(self) -> ::std::result::Result { ++ ::std::result::Result::Ok(crate::operation::get_string_utf8::GetStringUTF8Input { value: self.value }) ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8/_get_string_utf8_output.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8/_get_string_utf8_output.rs +new file mode 100644 +index 00000000..fe91d670 +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8/_get_string_utf8_output.rs +@@ -0,0 +1,47 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++#[allow(missing_docs)] // documentation missing in model ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] ++pub struct GetStringUTF8Output { ++ #[allow(missing_docs)] // documentation missing in model ++ pub value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringUTF8Output { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(&self) -> ::std::option::Option<&str> { ++ self.value.as_deref() ++ } ++} ++impl GetStringUTF8Output { ++ /// Creates a new builder-style object to manufacture [`GetStringUTF8Output`](crate::operation::operation::GetStringUTF8Output). ++ pub fn builder() -> crate::operation::get_string_utf8::builders::GetStringUTF8OutputBuilder { ++ crate::operation::get_string_utf8::builders::GetStringUTF8OutputBuilder::default() ++ } ++} ++ ++/// A builder for [`GetStringUTF8Output`](crate::operation::operation::GetStringUTF8Output). ++#[non_exhaustive] ++#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] ++pub struct GetStringUTF8OutputBuilder { ++ pub(crate) value: ::std::option::Option<::std::string::String>, ++} ++impl GetStringUTF8OutputBuilder { ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { ++ self.value = ::std::option::Option::Some(input.into()); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { ++ self.value = input; ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { ++ &self.value ++ } ++ /// Consumes the builder and constructs a [`GetStringUTF8Output`](crate::operation::operation::GetStringUTF8Output). ++ pub fn build(self) -> ::std::result::Result { ++ ::std::result::Result::Ok(crate::operation::get_string_utf8::GetStringUTF8Output { value: self.value }) ++ } ++} +diff --git b/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8/builders.rs a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8/builders.rs +new file mode 100644 +index 00000000..56bbc83d +--- /dev/null ++++ a/TestModels/SimpleTypes/SimpleString/runtimes/rust/src/operation/get_string_utf8/builders.rs +@@ -0,0 +1,83 @@ ++// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ++pub use crate::operation::get_string_utf8::_get_string_utf8_output::GetStringUTF8OutputBuilder; ++ ++pub use crate::operation::get_string_utf8::_get_string_utf8_input::GetStringUTF8InputBuilder; ++ ++impl GetStringUTF8InputBuilder { ++ /// Sends a request with this input using the given client. ++ pub async fn send_with( ++ self, ++ client: &crate::Client, ++ ) -> ::std::result::Result< ++ crate::operation::get_string_utf8::GetStringUTF8Output, ++ crate::operation::get_string_utf8::GetStringUTF8Error ++ > { ++ let mut fluent_builder = client.get_string_utf8(); ++ fluent_builder.inner = self; ++ fluent_builder.send().await ++ } ++} ++/// Fluent builder constructing a request to `GetStringUTF8`. ++/// ++#[derive(::std::clone::Clone, ::std::fmt::Debug)] ++pub struct GetStringUTF8FluentBuilder { ++ handle: ::std::sync::Arc, ++ inner: crate::operation::get_string_utf8::builders::GetStringUTF8InputBuilder, ++ config_override: ::std::option::Option, ++} ++impl GetStringUTF8FluentBuilder { ++ /// Creates a new `GetStringUTF8`. ++ pub(crate) fn new(handle: ::std::sync::Arc) -> Self { ++ Self { ++ handle, ++ inner: ::std::default::Default::default(), ++ config_override: ::std::option::Option::None, ++ } ++ } ++ /// Access the GetStringUTF8 as a reference. ++ pub fn as_input(&self) -> &crate::operation::get_string_utf8::builders::GetStringUTF8InputBuilder { ++ &self.inner ++ } ++ /// Sends the request and returns the response. ++ pub async fn send( ++ self, ++ ) -> ::std::result::Result< ++ crate::operation::get_string_utf8::GetStringUTF8Output, ++ crate::operation::get_string_utf8::GetStringUTF8Error ++ > { ++ let input = self ++ .inner ++ .build() ++ // Using unhandled since GetString doesn't declare any validation, ++ // and smithy-rs seems to not generate a ValidationError case unless there is ++ // (but isn't that a backwards compatibility problem for output structures?) ++ // Vanilla smithy-rs uses SdkError::construction_failure, ++ // but we aren't using SdkError. ++ .map_err(crate::operation::get_string_utf8::GetStringUTF8Error::unhandled)?; ++ crate::operation::get_string_utf8::GetStringUTF8::send(&self.handle, input).await ++ } ++ ++ pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { ++ self.set_config_override(Some(config_override.into())); ++ self ++ } ++ ++ pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { ++ self.config_override = config_override; ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { ++ self.inner = self.inner.value(input.into()); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { ++ self.inner = self.inner.set_value(input); ++ self ++ } ++ #[allow(missing_docs)] // documentation missing in model ++ pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { ++ self.inner.get_value() ++ } ++} From 1df2d657beabe92c1a444a884198a708efe06584 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Wed, 24 Apr 2024 09:06:13 -0700 Subject: [PATCH 2/2] Back up version number --- .../codegen-patches/rust/{dafny-4.6.0.patch => dafny-4.5.0.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename TestModels/SimpleTypes/SimpleString/codegen-patches/rust/{dafny-4.6.0.patch => dafny-4.5.0.patch} (100%) diff --git a/TestModels/SimpleTypes/SimpleString/codegen-patches/rust/dafny-4.6.0.patch b/TestModels/SimpleTypes/SimpleString/codegen-patches/rust/dafny-4.5.0.patch similarity index 100% rename from TestModels/SimpleTypes/SimpleString/codegen-patches/rust/dafny-4.6.0.patch rename to TestModels/SimpleTypes/SimpleString/codegen-patches/rust/dafny-4.5.0.patch