pub struct TemplateProcessor { /* private fields */ }Expand description
テンプレートプロセッサ
Implementations§
Source§impl TemplateProcessor
impl TemplateProcessor
Sourcepub fn add_variable(&mut self, key: impl Into<String>, value: Value)
pub fn add_variable(&mut self, key: impl Into<String>, value: Value)
変数を追加
Sourcepub fn add_variables(&mut self, variables: Variables)
pub fn add_variables(&mut self, variables: Variables)
複数の変数を追加
Sourcepub fn add_env_variables(&mut self)
pub fn add_env_variables(&mut self)
環境変数を追加(安全なもののみ)
セキュリティ上の理由から、以下のプレフィックスを持つ環境変数のみを許可:
- FLOW_*: FleetFlow専用の環境変数
- CI_*: CI/CD環境の変数
- APP_*: アプリケーション設定
Sourcepub fn register_env_function(&mut self)
pub fn register_env_function(&mut self)
env() 関数を登録
Sourcepub fn render_str(&mut self, template: &str) -> Result<String>
pub fn render_str(&mut self, template: &str) -> Result<String>
文字列をテンプレートとして展開
Sourcepub fn render_file(&mut self, path: &Path) -> Result<String>
pub fn render_file(&mut self, path: &Path) -> Result<String>
ファイルを読み込んでテンプレート展開
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TemplateProcessor
impl !RefUnwindSafe for TemplateProcessor
impl Send for TemplateProcessor
impl Sync for TemplateProcessor
impl Unpin for TemplateProcessor
impl !UnwindSafe for TemplateProcessor
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