Bentrix Docs
HomePricingDashboard

Rust: templates

Every method of client.template() in the Rust SDK.

apply#

Apply a template · tool template_apply

scope: labplan: plussince 1.0.0

Applies a saved template — or blank, no studies — to a chart or every chart of its workbench, as the templates menu does; what could not be applied is said, one line each. Answers the chart and those lines.

Declaration

client.template()
pub fn apply(&self, args: TemplateApplyArgs) -> Result<Value

Parameters

NameTypeWhat it is
chartimpl Into<String>required
all_chartsbooloptionalOnto every chart of the chart's workbench, as the menu's All switch.
blankbooloptional
nameimpl Into<String>optionalThe template's name; absent with blank, which takes every study off.

Returns

Result<Value, Error> — the tool’s answer as a serde_json::Value.

What it answers

Answers the chart and those lines.

Example

client.template().apply(mcp::TemplateApplyArgs::new(chart.clone()))?

delete#

Delete a template · tool template_delete

scope: labplan: plussince 1.0.0

Deletes a saved template, as its row's x and the confirmation do — only with confirm; without it the answer names what would be deleted. Answers the templates.

Declaration

client.template()
pub fn delete(&self, args: TemplateDeleteArgs) -> Result<Value

Parameters

NameTypeWhat it is
nameimpl Into<String>required
confirmbooloptionalWithout it nothing is deleted and the answer says what would be.

Returns

Result<Value, Error> — the tool’s answer as a serde_json::Value.

What it answers

Answers the templates.

Example

client.template().delete(mcp::TemplateDeleteArgs::new("…"))?

rename#

Rename a template · tool template_rename

scope: labplan: plussince 1.0.0

Renames a saved template, as its gear's Rename does. Answers the templates.

Declaration

client.template()
pub fn rename(&self, args: TemplateRenameArgs) -> Result<Value

Parameters

NameTypeWhat it is
nameimpl Into<String>required
toimpl Into<String>required

Returns

Result<Value, Error> — the tool’s answer as a serde_json::Value.

What it answers

Answers the templates.

Example

client.template().rename(mcp::TemplateRenameArgs::new("…", "…"))?

save#

Save a template · tool template_save

scope: labplan: plussince 1.0.0

Saves a chart's studies — and its type and look with with_type — as a named template, as the templates menu's Save does; a name taken or unusable is refused in its words. Answers the templates.

Declaration

client.template()
pub fn save(&self, args: TemplateSaveArgs) -> Result<Value

Parameters

NameTypeWhat it is
chartimpl Into<String>requiredThe chart whose studies (and, with with_type, type and look) become the template.
nameimpl Into<String>required
with_typebooloptionalThe chart's type and look saved with its studies.

Returns

Result<Value, Error> — the tool’s answer as a serde_json::Value.

What it answers

Answers the templates.

Example

client.template().save(mcp::TemplateSaveArgs::new(chart.clone(), "…"))?

set_default#

Set an interval's default template · tool template_set_default

scope: labplan: plussince 1.0.0

Makes a template the one a new chart of an interval opens with, or takes the default off an interval or off every interval a template is the default of, as the template gear's choices do. Answers the templates.

Declaration

client.template()
pub fn set_default(&self, args: TemplateSetDefaultArgs) -> Result<Value

Parameters

NameTypeWhat it is
clear_allbooloptionalEvery interval this template is the default of loses it.
intervalimpl Into<String>optionalThe interval it opens with, as the menu writes it (M1, H4, D1); absent with clear_all.
nameimpl Into<String>optionalThe template, or absent to make the interval open with none.

Returns

Result<Value, Error> — the tool’s answer as a serde_json::Value.

What it answers

Answers the templates.

Example

client.template().set_default(mcp::TemplateSetDefaultArgs::new())?

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed