Skip to main content

ObjectServer

Trait ObjectServer 

Source
pub trait ObjectServer {
    // Required methods
    fn create_root(
        &self,
        object_name: String,
        script_path: Option<PathBuf>,
    ) -> Option<DefaultKey>;
    fn create_child(
        &self,
        object_name: String,
        script_path: Option<PathBuf>,
    ) -> Option<DefaultKey>;
    fn create_child_for(
        &self,
        object_name: String,
        script_path: Option<PathBuf>,
        parent_object: DefaultKey,
    ) -> Option<DefaultKey>;
    fn remove(&self, object_id: DefaultKey) -> bool;
    fn set_script(&self, object_id: DefaultKey, script_path: PathBuf) -> bool;
    fn remove_script(&self, object_id: DefaultKey) -> bool;
    fn move_to_parent(
        &self,
        child_object_id: DefaultKey,
        new_parent_id: DefaultKey,
    ) -> bool;
    fn get_by_id(&self, object_id: DefaultKey) -> Option<DefaultKey>;
    fn get_by_name(&self, object_name: PathBuf) -> Option<DefaultKey>;
}

Required Methods§

Source

fn create_root( &self, object_name: String, script_path: Option<PathBuf>, ) -> Option<DefaultKey>

Создаёт корневой объект Возвращает None, если родитель не существует

Source

fn create_child( &self, object_name: String, script_path: Option<PathBuf>, ) -> Option<DefaultKey>

Создаёт дочерний объект для себя Возвращает None, если родитель не существует

Source

fn create_child_for( &self, object_name: String, script_path: Option<PathBuf>, parent_object: DefaultKey, ) -> Option<DefaultKey>

Создаёт дочерний объект для parent_object Возвращает None, если родитель не существует

Source

fn remove(&self, object_id: DefaultKey) -> bool

Удаляет объект и всё его поддерево

Source

fn set_script(&self, object_id: DefaultKey, script_path: PathBuf) -> bool

Source

fn remove_script(&self, object_id: DefaultKey) -> bool

Source

fn move_to_parent( &self, child_object_id: DefaultKey, new_parent_id: DefaultKey, ) -> bool

Source

fn get_by_id(&self, object_id: DefaultKey) -> Option<DefaultKey>

Source

fn get_by_name(&self, object_name: PathBuf) -> Option<DefaultKey>

Implementors§