Struct const_format::Sliced [−][src]
pub struct Sliced<T, R>(pub T, pub R);
fmt
only.Expand description
Wrapper for writing a range of a string slice.
This is a workaround for not being able to do &string[start..end]
at compile-time.
Example
#![feature(const_mut_refs)]
use const_format::Sliced;
use const_format::{concatc, formatc};
const NUMS: &str = "0123456789";
const SRC: &str = "foo bar baz";
assert_eq!(concatc!(Sliced(NUMS, 1..=4)), "1234");
assert_eq!(concatc!(Sliced(SRC, 0..5), "ros."), "foo bros.");
assert_eq!(formatc!("{}", Sliced(NUMS, 4..)), "456789");
assert_eq!(formatc!("{}t", Sliced(SRC, 4..7)), "bart");
Tuple Fields
0: T
1: R
Implementations
Trait Implementations
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more
type Kind = IsNotStdKind
type Kind = IsNotStdKind
What kind of type this is, this can be one of: Read more