pub struct TemplateLoader { /* private fields */ }Implementations§
Source§impl TemplateLoader
impl TemplateLoader
pub fn new() -> Self
pub fn add_search_path(&mut self, path: impl Into<PathBuf>) -> &mut Self
pub fn set_variable( &mut self, key: impl Into<String>, value: impl Into<String>, ) -> &mut Self
pub fn set_variables(&mut self, vars: HashMap<String, String>) -> &mut Self
pub fn get_variable(&self, key: &str) -> Option<&str>
pub fn load_template(&self, name: &str) -> Result<String>
pub fn template_exists(&self, name: &str) -> bool
pub fn search_paths(&self) -> &[PathBuf]
pub fn variables(&self) -> &HashMap<String, String>
pub fn load_and_parse(&self, template_name: &str) -> Result<AgentSpec>
Trait Implementations§
Source§impl AsRef<TemplateLoader> for TemplateLoader
impl AsRef<TemplateLoader> for TemplateLoader
Source§fn as_ref(&self) -> &InnerTemplateLoader
fn as_ref(&self) -> &InnerTemplateLoader
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Default for TemplateLoader
impl Default for TemplateLoader
Source§impl From<TemplateLoader> for TemplateLoader
impl From<TemplateLoader> for TemplateLoader
Source§fn from(inner: InnerTemplateLoader) -> Self
fn from(inner: InnerTemplateLoader) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TemplateLoader
impl RefUnwindSafe for TemplateLoader
impl Send for TemplateLoader
impl Sync for TemplateLoader
impl Unpin for TemplateLoader
impl UnsafeUnpin for TemplateLoader
impl UnwindSafe for TemplateLoader
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreCreates a shared type from an unshared type.