EditContext

Struct EditContext 

Source
pub struct EditContext { /* private fields */ }

Implementations§

Source§

impl EditContext

Source

pub fn apply_diff(&mut self, diff: &DataSetDiff) -> DataSetResult<()>

Source

pub fn new( project_config: &HydrateProjectConfiguration, edit_context_key: EditContextKey, schema_set: SchemaSet, undo_stack: &UndoStack, ) -> Self

Source

pub fn new_with_data( project_config: &HydrateProjectConfiguration, edit_context_key: EditContextKey, schema_set: SchemaSet, undo_stack: &UndoStack, ) -> Self

Source

pub fn with_undo_context<F: FnOnce(&mut Self) -> EndContextBehavior>( &mut self, name: &'static str, f: F, )

Source

pub fn commit_pending_undo_context(&mut self)

Source

pub fn cancel_pending_undo_context(&mut self) -> DataSetResult<()>

Source

pub fn schema_set(&self) -> &SchemaSet

Source

pub fn schemas(&self) -> &HashMap<SchemaFingerprint, SchemaNamedType>

Source

pub fn data_set(&self) -> &DataSet

Source

pub fn assets(&self) -> &HashMap<AssetId, DataSetAssetInfo>

Source

pub fn has_asset(&self, asset_id: AssetId) -> bool

Source

pub fn new_asset_with_id( &mut self, asset_id: AssetId, asset_name: &AssetName, asset_location: &AssetLocation, schema: &SchemaRecord, ) -> DataSetResult<()>

Source

pub fn new_asset( &mut self, asset_name: &AssetName, asset_location: &AssetLocation, schema: &SchemaRecord, ) -> AssetId

Source

pub fn new_asset_from_prototype( &mut self, asset_name: &AssetName, asset_location: &AssetLocation, prototype: AssetId, ) -> DataSetResult<AssetId>

Source

pub fn init_from_single_object( &mut self, asset_id: AssetId, asset_name: AssetName, asset_location: AssetLocation, single_object: &SingleObject, ) -> DataSetResult<()>

Source

pub fn restore_assets_from(&mut self, data_set: DataSet) -> DataSetResult<()>

Source

pub fn duplicate_asset(&mut self, asset_id: AssetId) -> DataSetResult<AssetId>

Source

pub fn delete_asset(&mut self, asset_id: AssetId) -> DataSetResult<()>

Source

pub fn set_asset_location( &mut self, asset_id: AssetId, new_location: AssetLocation, ) -> DataSetResult<()>

Source

pub fn set_import_info( &mut self, asset_id: AssetId, import_info: ImportInfo, ) -> DataSetResult<()>

Source

pub fn asset_name(&self, asset_id: AssetId) -> DataSetResult<&AssetName>

Source

pub fn asset_name_or_id_string( &self, asset_id: AssetId, ) -> DataSetResult<String>

Source

pub fn set_asset_name( &mut self, asset_id: AssetId, asset_name: AssetName, ) -> DataSetResult<()>

Source

pub fn asset_location(&self, asset_id: AssetId) -> Option<AssetLocation>

Source

pub fn asset_location_chain( &self, asset_id: AssetId, ) -> DataSetResult<Vec<AssetLocation>>

Source

pub fn import_info(&self, asset_id: AssetId) -> Option<&ImportInfo>

Source

pub fn resolve_path_reference<P: Into<PathReference>>( &self, asset_id: AssetId, path: P, ) -> DataSetResult<Option<AssetId>>

Source

pub fn resolve_canonical_path_reference( &self, asset_id: AssetId, canonical_path: &CanonicalPathReference, ) -> DataSetResult<Option<AssetId>>

Source

pub fn resolve_all_path_reference_overrides( &self, asset_id: AssetId, ) -> DataSetResult<HashMap<CanonicalPathReference, AssetId>>

Source

pub fn get_all_path_reference_overrides( &mut self, asset_id: AssetId, ) -> Option<&HashMap<CanonicalPathReference, AssetId>>

Source

pub fn set_path_reference_override( &mut self, asset_id: AssetId, path: CanonicalPathReference, referenced_asset_id: AssetId, ) -> DataSetResult<()>

Source

pub fn asset_prototype(&self, asset_id: AssetId) -> Option<AssetId>

Source

pub fn asset_schema(&self, asset_id: AssetId) -> Option<&SchemaRecord>

Source

pub fn get_null_override( &self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<NullOverride>

Source

pub fn set_null_override( &mut self, asset_id: AssetId, path: impl AsRef<str>, null_override: NullOverride, ) -> DataSetResult<()>

Source

pub fn resolve_null_override( &self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<NullOverride>

Source

pub fn has_property_override( &self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<bool>

Source

pub fn get_property_override( &self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<Option<&Value>>

Source

pub fn set_property_override( &mut self, asset_id: AssetId, path: impl AsRef<str>, value: Option<Value>, ) -> DataSetResult<Option<Value>>

Source

pub fn apply_property_override_to_prototype( &mut self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<()>

Source

pub fn resolve_property( &self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<&Value>

Source

pub fn get_dynamic_array_entries( &self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<Iter<'_, Uuid>>

Source

pub fn get_map_entries( &self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<Iter<'_, Uuid>>

Source

pub fn add_dynamic_array_entry( &mut self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<Uuid>

Source

pub fn add_map_entry( &mut self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<Uuid>

Source

pub fn insert_dynamic_array_entry( &mut self, asset_id: AssetId, path: impl AsRef<str>, index: usize, entry_uuid: Uuid, ) -> DataSetResult<()>

Source

pub fn remove_dynamic_array_entry( &mut self, asset_id: AssetId, path: impl AsRef<str>, element_id: Uuid, ) -> DataSetResult<bool>

Source

pub fn remove_map_entry( &mut self, asset_id: AssetId, path: impl AsRef<str>, element_id: Uuid, ) -> DataSetResult<bool>

Source

pub fn resolve_dynamic_array_entries( &self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<Box<[Uuid]>>

Source

pub fn resolve_map_entries( &self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<Box<[Uuid]>>

Source

pub fn get_override_behavior( &self, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<OverrideBehavior>

Source

pub fn set_override_behavior( &mut self, asset_id: AssetId, path: impl AsRef<str>, behavior: OverrideBehavior, ) -> DataSetResult<()>

Source

pub fn read_properties_bundle( &self, schema_set: &SchemaSet, asset_id: AssetId, path: impl AsRef<str>, ) -> DataSetResult<PropertiesBundle>

Source

pub fn write_properties_bundle( &mut self, schema_set: &SchemaSet, asset_id: AssetId, path: impl AsRef<str>, properties_bundle: &PropertiesBundle, ) -> DataSetResult<()>

Trait Implementations§

Source§

impl DynEditContext for EditContext

Source§

impl PathReferenceNamespaceResolver for EditContext

Source§

fn namespace_root(&self, namespace: &str) -> Option<PathBuf>

Source§

fn simplify_path(&self, path: &Path) -> Option<(String, PathBuf)>

Source§

impl RestoreAssetFromStorageImpl for EditContext

Source§

fn restore_asset( &mut self, asset_id: AssetId, asset_name: AssetName, asset_location: AssetLocation, import_info: Option<ImportInfo>, build_info: BuildInfo, prototype: Option<AssetId>, schema: SchemaFingerprint, properties: HashMap<String, Value>, property_null_overrides: HashMap<String, NullOverride>, properties_in_replace_mode: HashSet<String>, dynamic_collection_entries: HashMap<String, OrderedSet<Uuid>>, ) -> DataSetResult<()>

Source§

fn namespace_resolver(&self) -> &dyn PathReferenceNamespaceResolver

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.