Skip to main content

IntoValueDefault

Trait IntoValueDefault 

Source
pub trait IntoValueDefault<T> {
    // Required method
    fn into_value_default(self) -> T;
}
Expand description

Converts ergonomic default arguments into the value type expected by a read API.

§Type Parameters

  • T - Owned default type required by the read operation.

§Examples

use qubit_value::IntoValueDefault;

let owned: String = "fallback".into_value_default();
assert_eq!(owned, "fallback");

Required Methods§

Source

fn into_value_default(self) -> T

Converts this argument into the default value.

§Returns

The owned default value expected by the read API.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoValueDefault<String> for &String

Source§

fn into_value_default(self) -> String

Clones the borrowed string into an owned default string.

§Returns

An owned string with the same contents as the input.

Source§

impl IntoValueDefault<String> for &str

Source§

fn into_value_default(self) -> String

Copies the borrowed string into an owned default string.

§Returns

An owned string with the same contents as the input.

Source§

impl IntoValueDefault<Vec<String>> for &Vec<&str>

Source§

fn into_value_default(self) -> Vec<String>

Copies each borrowed vector string into an owned default vector.

§Returns

An owned vector preserving the input element order.

Source§

impl IntoValueDefault<Vec<String>> for &[&str]

Source§

fn into_value_default(self) -> Vec<String>

Copies each borrowed slice string into an owned default vector.

§Returns

An owned vector preserving the input element order.

Source§

impl IntoValueDefault<Vec<String>> for Vec<&str>

Source§

fn into_value_default(self) -> Vec<String>

Copies each borrowed string into an owned default vector.

§Returns

An owned vector preserving the input element order.

Source§

impl<T, const N: usize> IntoValueDefault<Vec<T>> for &[T; N]
where T: Clone,

Source§

fn into_value_default(self) -> Vec<T>

Clones the borrowed array elements into an owned default vector.

§Returns

An owned vector preserving the input element order.

Source§

impl<T, const N: usize> IntoValueDefault<Vec<T>> for [T; N]

Source§

fn into_value_default(self) -> Vec<T>

Moves the array elements into an owned default vector.

§Returns

An owned vector preserving the input element order.

Source§

impl<T> IntoValueDefault<Vec<T>> for &Vec<T>
where T: Clone,

Source§

fn into_value_default(self) -> Vec<T>

Clones the borrowed vector elements into an owned default vector.

§Returns

An owned vector preserving the input element order.

Source§

impl<T> IntoValueDefault<Vec<T>> for &[T]
where T: Clone,

Source§

fn into_value_default(self) -> Vec<T>

Clones the borrowed slice elements into an owned default vector.

§Returns

An owned vector preserving the input element order.

Source§

impl<const N: usize> IntoValueDefault<Vec<String>> for &[&str; N]

Source§

fn into_value_default(self) -> Vec<String>

Copies each borrowed array string into an owned default vector.

§Returns

An owned vector preserving the input element order.

Source§

impl<const N: usize> IntoValueDefault<Vec<String>> for [&str; N]

Source§

fn into_value_default(self) -> Vec<String>

Copies each borrowed array string into an owned default vector.

§Returns

An owned vector preserving the input element order.

Implementors§

Source§

impl<T> IntoValueDefault<T> for T