pub trait IntoOption<T> {
// Required method
fn into_option(self) -> Option<T>;
}Expand description
Utility trait for builder methods for optional values.
This allows the caller to either pass in the value itself without wrapping it in Some,
or to just pass in an Option if that is what they have.
Required Methods§
fn into_option(self) -> Option<T>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl IntoOption<MessageId> for &str
impl IntoOption<MessageId> for &str
fn into_option(self) -> Option<MessageId>
Source§impl IntoOption<String> for &String
impl IntoOption<String> for &String
fn into_option(self) -> Option<String>
Source§impl IntoOption<String> for &mut str
impl IntoOption<String> for &mut str
fn into_option(self) -> Option<String>
Source§impl IntoOption<String> for &str
impl IntoOption<String> for &str
fn into_option(self) -> Option<String>
Source§impl IntoOption<ToolCallId> for &str
impl IntoOption<ToolCallId> for &str
fn into_option(self) -> Option<ToolCallId>
Source§impl IntoOption<ToolCallId> for &str
Available on crate feature unstable_protocol_v2 only.
impl IntoOption<ToolCallId> for &str
Available on crate feature
unstable_protocol_v2 only.