pub trait ObjectServer {
// Required methods
fn create_root(
&self,
object_name: String,
script_path: Option<PathBuf>,
) -> DefaultKey;
fn create_child(
&self,
object_name: String,
script_path: Option<PathBuf>,
parent_object: DefaultKey,
) -> Option<DefaultKey>;
fn remove(&self, object_id: DefaultKey);
fn set_script(&self, object_id: DefaultKey, script_path: PathBuf) -> bool;
fn remove_script(&self, object_id: DefaultKey) -> bool;
fn move_to_parent(
&self,
childe_object_id: DefaultKey,
new_parent_id: DefaultKey,
) -> bool;
}Required Methods§
Sourcefn create_root(
&self,
object_name: String,
script_path: Option<PathBuf>,
) -> DefaultKey
fn create_root( &self, object_name: String, script_path: Option<PathBuf>, ) -> DefaultKey
Создаёт корневой объект (без родителя)
Sourcefn create_child(
&self,
object_name: String,
script_path: Option<PathBuf>,
parent_object: DefaultKey,
) -> Option<DefaultKey>
fn create_child( &self, object_name: String, script_path: Option<PathBuf>, parent_object: DefaultKey, ) -> Option<DefaultKey>
Создаёт дочерний объект
Возвращает None, если родитель не существует
Sourcefn remove(&self, object_id: DefaultKey)
fn remove(&self, object_id: DefaultKey)
Удаляет объект и всё его поддерево