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§
Sourcefn create_root(
&self,
object_name: String,
script_path: Option<PathBuf>,
) -> Option<DefaultKey>
fn create_root( &self, object_name: String, script_path: Option<PathBuf>, ) -> Option<DefaultKey>
Создаёт корневой объект
Возвращает None, если родитель не существует
Sourcefn create_child(
&self,
object_name: String,
script_path: Option<PathBuf>,
) -> Option<DefaultKey>
fn create_child( &self, object_name: String, script_path: Option<PathBuf>, ) -> Option<DefaultKey>
Создаёт дочерний объект для себя
Возвращает None, если родитель не существует
Sourcefn create_child_for(
&self,
object_name: String,
script_path: Option<PathBuf>,
parent_object: DefaultKey,
) -> Option<DefaultKey>
fn create_child_for( &self, object_name: String, script_path: Option<PathBuf>, parent_object: DefaultKey, ) -> Option<DefaultKey>
Создаёт дочерний объект для parent_object
Возвращает None, если родитель не существует
Sourcefn remove(&self, object_id: DefaultKey) -> bool
fn remove(&self, object_id: DefaultKey) -> bool
Удаляет объект и всё его поддерево