@@ -57,15 +57,13 @@ mod content;
5757mod elicitation;
5858mod error;
5959mod ext;
60- mod maybe_undefined;
6160#[ cfg( feature = "unstable_nes" ) ]
6261mod nes;
63- #[ cfg( feature = "unstable_llm_providers" ) ]
64- mod nullable;
6562mod plan;
6663#[ cfg( feature = "unstable_cancel_request" ) ]
6764mod protocol_level;
6865mod rpc;
66+ mod serde_util;
6967mod tool_call;
7068mod version;
7169
@@ -77,27 +75,20 @@ use derive_more::{Display, From};
7775pub use elicitation:: * ;
7876pub use error:: * ;
7977pub use ext:: * ;
80- pub use maybe_undefined:: * ;
8178#[ cfg( feature = "unstable_nes" ) ]
8279pub use nes:: * ;
83- #[ cfg( feature = "unstable_llm_providers" ) ]
84- pub use nullable:: * ;
8580pub use plan:: * ;
8681#[ cfg( feature = "unstable_cancel_request" ) ]
8782pub use protocol_level:: * ;
8883pub use rpc:: * ;
8984pub use serde_json:: value:: RawValue ;
85+ pub use serde_util:: * ;
9086pub use tool_call:: * ;
9187pub use version:: * ;
9288
9389use schemars:: JsonSchema ;
9490use serde:: { Deserialize , Serialize } ;
95- use std:: {
96- borrow:: Cow ,
97- ffi:: OsStr ,
98- path:: { Path , PathBuf } ,
99- sync:: Arc ,
100- } ;
91+ use std:: sync:: Arc ;
10192
10293/// A unique identifier for a conversation session between a client and agent.
10394///
@@ -117,100 +108,3 @@ impl SessionId {
117108 Self ( id. into ( ) )
118109 }
119110}
120-
121- /// Utility trait for builder methods for optional values.
122- /// This allows the caller to either pass in the value itself without wrapping it in `Some`,
123- /// or to just pass in an Option if that is what they have.
124- pub trait IntoOption < T > {
125- fn into_option ( self ) -> Option < T > ;
126- }
127-
128- impl < T > IntoOption < T > for Option < T > {
129- fn into_option ( self ) -> Option < T > {
130- self
131- }
132- }
133-
134- impl < T > IntoOption < T > for T {
135- fn into_option ( self ) -> Option < T > {
136- Some ( self )
137- }
138- }
139-
140- impl IntoOption < String > for & str {
141- fn into_option ( self ) -> Option < String > {
142- Some ( self . into ( ) )
143- }
144- }
145-
146- impl IntoOption < String > for & mut str {
147- fn into_option ( self ) -> Option < String > {
148- Some ( self . into ( ) )
149- }
150- }
151-
152- impl IntoOption < String > for & String {
153- fn into_option ( self ) -> Option < String > {
154- Some ( self . into ( ) )
155- }
156- }
157-
158- impl IntoOption < String > for Box < str > {
159- fn into_option ( self ) -> Option < String > {
160- Some ( self . into ( ) )
161- }
162- }
163-
164- impl IntoOption < String > for Cow < ' _ , str > {
165- fn into_option ( self ) -> Option < String > {
166- Some ( self . into ( ) )
167- }
168- }
169-
170- impl IntoOption < String > for Arc < str > {
171- fn into_option ( self ) -> Option < String > {
172- Some ( self . to_string ( ) )
173- }
174- }
175-
176- impl < T : ?Sized + AsRef < OsStr > > IntoOption < PathBuf > for & T {
177- fn into_option ( self ) -> Option < PathBuf > {
178- Some ( self . into ( ) )
179- }
180- }
181-
182- impl IntoOption < PathBuf > for Box < Path > {
183- fn into_option ( self ) -> Option < PathBuf > {
184- Some ( self . into ( ) )
185- }
186- }
187-
188- impl IntoOption < PathBuf > for Cow < ' _ , Path > {
189- fn into_option ( self ) -> Option < PathBuf > {
190- Some ( self . into ( ) )
191- }
192- }
193-
194- impl IntoOption < ToolCallId > for & str {
195- fn into_option ( self ) -> Option < ToolCallId > {
196- Some ( ToolCallId :: new ( self ) )
197- }
198- }
199-
200- impl IntoOption < serde_json:: Value > for & str {
201- fn into_option ( self ) -> Option < serde_json:: Value > {
202- Some ( self . into ( ) )
203- }
204- }
205-
206- impl IntoOption < serde_json:: Value > for String {
207- fn into_option ( self ) -> Option < serde_json:: Value > {
208- Some ( self . into ( ) )
209- }
210- }
211-
212- impl IntoOption < serde_json:: Value > for Cow < ' _ , str > {
213- fn into_option ( self ) -> Option < serde_json:: Value > {
214- Some ( self . into ( ) )
215- }
216- }
0 commit comments