pub struct Content(/* private fields */);
Expand description

Represents a sequence of ContentItems.

Implementations§

source§

impl Content

source

pub fn generate_content(&self, args: &Vec<String>) -> String

Generates the content for this Content object based on the provided arguments.

It processes each ContentItem in the sequence and generates the final content by replacing variable placeholders with their corresponding values from args.

§Examples
use shortcut_autotyper::Content;
let vec = vec![String::from("shortcut-autotyper"), String::from("X")];
let content = Content::from("A <1> B");
assert_eq!(&content.generate_content(&vec), "A X B");

Trait Implementations§

source§

impl From<&str> for Content

source§

fn from(value: &str) -> Self

Parses a string and constructs a Content object.

The input string is processed character by character, identifying fixed values and variable placeholders, and constructing the Content accordingly.

source§

impl ToString for Content

source§

fn to_string(&self) -> String

Converts the Content into a single string by concatenating its constituent items.

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V