Skip to main content

ArgValue

Enum ArgValue 

Source
#[non_exhaustive]
pub enum ArgValue { Str(Text), Int(i64), Float(f64), Decimal(Text), DateTime(Arc<DateTimeValue>), Custom(Arc<dyn CustomValue + Send + Sync>), Source(Arc<dyn ArgSource>), Unset, }
Expand description

The call-site core: what tr! builds, and what formats it against a catalog the caller supplies. The call-site core: what tr! builds, and what formats it against a catalog the caller supplies. The call-site core: what tr! builds, and what formats it against a catalog the caller supplies. One positional argument of a call site: owned, 'static and Send + Sync, so a description can sit in a const, cross a thread, or wait in a registry until something renders it.

Every variant is borrowed into one Arg.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Str(Text)

A string.

§

Int(i64)

An integer.

§

Float(f64)

A float.

§

Decimal(Text)

An exact decimal as number-literal text (-12.50, 1e3).

§

DateTime(Arc<DateTimeValue>)

A date/time.

§

Custom(Arc<dyn CustomValue + Send + Sync>)

An application value: what carries a measure, a date or a value a custom function downcasts (CustomValue).

§

Source(Arc<dyn ArgSource>)

A value read at format time (ArgSource).

§

Unset

No value: the message reports an Unresolved Variable, as the spec requires.

Implementations§

Source§

impl ArgValue

Source

pub fn decimal(text: impl Into<Text>) -> ArgValue

An exact decimal from its number-literal text. The runtime formats and selects on the digits as written, with no float in between.

Source

pub fn custom<C: CustomValue + Send + Sync + 'static>(value: C) -> ArgValue

An application value.

Source

pub fn source<S: ArgSource + 'static>(source: S) -> ArgValue

A value read at format time (ArgSource).

Trait Implementations§

Source§

impl Clone for ArgValue

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ArgValue

Every variant as written, but for the two whose value is the application’s own and has no Debug to call: Custom(..), Source(..).

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&OsString> for ArgValue

Available on crate feature host-std, or crate feature native, or (crate features csr or hydrate or ssr) and (crate features leptos-0-8 or leptos) only.

As &PathBuf.

Source§

fn from(s: &OsString) -> ArgValue

Converts to this type from the input type.
Source§

impl From<&PathBuf> for ArgValue

Available on crate feature host-std, or crate feature native, or (crate features csr or hydrate or ssr) and (crate features leptos-0-8 or leptos) only.

Beside &T for T: IntoArg + Copy, a reference to a type that is not Copy cannot be an IntoArg; tr! takes it through this.

Source§

fn from(p: &PathBuf) -> ArgValue

Converts to this type from the input type.
Source§

impl From<&String> for ArgValue

Source§

fn from(s: &String) -> ArgValue

Converts to this type from the input type.
Source§

impl From<&Zoned> for ArgValue

Available on crate feature native only.

As Zoned: Zoned is not Copy, so its reference is not an IntoArg (and would otherwise be taken as its text).

Source§

fn from(z: &Zoned) -> ArgValue

Converts to this type from the input type.
Source§

impl From<&str> for ArgValue

Any string slice, copied: a call site’s &str is rarely 'static (user.name()), and a description outlives the call. A literal keeps its &'static str through ArgValue::str_static, which is what the macro emits for one.

Source§

fn from(s: &str) -> ArgValue

Converts to this type from the input type.
Source§

impl<C: CustomValue + Send + Sync + 'static> From<Arc<C>> for ArgValue

Source§

fn from(c: Arc<C>) -> ArgValue

Converts to this type from the input type.
Source§

impl From<Arc<str>> for ArgValue

Source§

fn from(s: Arc<str>) -> ArgValue

Converts to this type from the input type.
Source§

impl<T> From<ArcMemo<T>> for ArgValue
where T: Into<ArgValue> + Clone + Send + Sync + 'static,

Available on crate features csr or hydrate or ssr only.
Source§

fn from(signal: ArcMemo<T>) -> ArgValue

Converts to this type from the input type.
Source§

impl<T> From<ArcReadSignal<T>> for ArgValue
where T: Into<ArgValue> + Clone + Send + Sync + 'static,

Available on crate features csr or hydrate or ssr only.
Source§

fn from(signal: ArcReadSignal<T>) -> ArgValue

Converts to this type from the input type.
Source§

impl<T> From<ArcRwSignal<T>> for ArgValue
where T: Into<ArgValue> + Clone + Send + Sync + 'static,

Available on crate features csr or hydrate or ssr only.
Source§

fn from(signal: ArcRwSignal<T>) -> ArgValue

Converts to this type from the input type.
Source§

impl<T> From<ArcSignal<T>> for ArgValue
where T: Into<ArgValue> + Clone + Send + Sync + 'static,

Available on crate features csr or hydrate or ssr only.
Source§

fn from(signal: ArcSignal<T>) -> ArgValue

Converts to this type from the input type.
Source§

impl From<DateTime<'_>> for ArgValue

Source§

fn from(d: DateTime<'_>) -> ArgValue

Converts to this type from the input type.
Source§

impl From<DateTimeValue> for ArgValue

Source§

fn from(d: DateTimeValue) -> ArgValue

Converts to this type from the input type.
Source§

impl<T> From<Memo<T>> for ArgValue
where T: Into<ArgValue> + Clone + Send + Sync + 'static,

Available on crate features csr or hydrate or ssr only.
Source§

fn from(signal: Memo<T>) -> ArgValue

Converts to this type from the input type.
Source§

impl<T> From<ReadSignal<T>> for ArgValue
where T: Into<ArgValue> + Clone + Send + Sync + 'static,

Available on crate features csr or hydrate or ssr only.
Source§

fn from(signal: ReadSignal<T>) -> ArgValue

Converts to this type from the input type.
Source§

impl<T> From<RwSignal<T>> for ArgValue
where T: Into<ArgValue> + Clone + Send + Sync + 'static,

Available on crate features csr or hydrate or ssr only.
Source§

fn from(signal: RwSignal<T>) -> ArgValue

Converts to this type from the input type.
Source§

impl<T> From<Signal<T>> for ArgValue
where T: Into<ArgValue> + Clone + Send + Sync + 'static,

Available on crate features csr or hydrate or ssr only.
Source§

fn from(signal: Signal<T>) -> ArgValue

Converts to this type from the input type.
Source§

impl From<String> for ArgValue

Source§

fn from(s: String) -> ArgValue

Converts to this type from the input type.
Source§

impl From<Text> for ArgValue

Source§

fn from(t: Text) -> ArgValue

Converts to this type from the input type.
Source§

impl From<char> for ArgValue

Source§

fn from(c: char) -> ArgValue

Converts to this type from the input type.
Source§

impl From<f32> for ArgValue

Source§

fn from(x: f32) -> ArgValue

Converts to this type from the input type.
Source§

impl From<f64> for ArgValue

Source§

fn from(x: f64) -> ArgValue

Converts to this type from the input type.
Source§

impl From<i8> for ArgValue

Source§

fn from(n: i8) -> ArgValue

Converts to this type from the input type.
Source§

impl From<i16> for ArgValue

Source§

fn from(n: i16) -> ArgValue

Converts to this type from the input type.
Source§

impl From<i32> for ArgValue

Source§

fn from(n: i32) -> ArgValue

Converts to this type from the input type.
Source§

impl From<i64> for ArgValue

Source§

fn from(n: i64) -> ArgValue

Converts to this type from the input type.
Source§

impl From<u8> for ArgValue

Source§

fn from(n: u8) -> ArgValue

Converts to this type from the input type.
Source§

impl From<u16> for ArgValue

Source§

fn from(n: u16) -> ArgValue

Converts to this type from the input type.
Source§

impl From<u32> for ArgValue

Source§

fn from(n: u32) -> ArgValue

Converts to this type from the input type.
Source§

impl From<usize> for ArgValue

A count: usize is 32-bit on the client, and no collection a server holds is longer than i64::MAX.

Source§

fn from(n: usize) -> ArgValue

Converts to this type from the input type.
Source§

impl IntoArg for ArgValue

Source§

fn into_arg(self) -> ArgValue

The argument’s value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SerializableKey for T

Source§

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more