DashboardLayoutManager

Struct DashboardLayoutManager 

Source
pub struct DashboardLayoutManager { /* private fields */ }
Expand description

Dashboard layout manager

Implementations§

Source§

impl DashboardLayoutManager

Source

pub fn new(layouts_dir: String) -> Result<Self>

Create a new layout manager

Source

pub fn save_layout(&self, layout: &DashboardLayout) -> Result<()>

Save a dashboard layout

Source

pub fn load_layout(&self, layout_id: &str) -> Result<DashboardLayout>

Load a dashboard layout

Source

pub fn list_layouts(&self) -> Result<Vec<DashboardLayoutInfo>>

List all dashboard layouts

Source

pub fn delete_layout(&self, layout_id: &str) -> Result<()>

Delete a dashboard layout

Source

pub fn clone_layout( &self, source_id: &str, new_name: &str, new_author: &str, ) -> Result<DashboardLayout>

Clone a dashboard layout with a new ID

Source

pub fn export_layout(&self, layout_id: &str) -> Result<String>

Export layout to JSON string

Source

pub fn import_layout(&self, json: &str) -> Result<DashboardLayout>

Import layout from JSON string

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

Source§

fn len(&self) -> usize

The number of items that this chain link consists of.
Source§

fn append_to(self, v: &mut Vec<T>)

Append the elements in this link to the chain.
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>,

Source§

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>,

Source§

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<T> ErasedDestructor for T
where T: 'static,