pub struct Placeholder {
pub value: String,
pub type_: Option<String>,
}
Expand description
This struct represents a placeholder in a JSON object.
Fields§
§value: String
The placeholder value.
type_: Option<String>
The placeholder type.
Implementations§
Source§impl Placeholder
impl Placeholder
Sourcepub fn placeholders(value: &str) -> Vec<Self>
pub fn placeholders(value: &str) -> Vec<Self>
Get all the placeholders in a string. If value == “{time} {time:3}”, then placeholders == [“{time}”, “{time:3}”]. If value == “{time:{time:5}} {time}”, then placeholders == [“{time:{time:5}}”, “{time}”].
Trait Implementations§
Source§impl Clone for Placeholder
impl Clone for Placeholder
Source§fn clone(&self) -> Placeholder
fn clone(&self) -> Placeholder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for Placeholder
impl RefUnwindSafe for Placeholder
impl Send for Placeholder
impl Sync for Placeholder
impl Unpin for Placeholder
impl UnwindSafe for Placeholder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more