Creates a new [`Entity`]. # Errors: - if the [`EntityType`] doesn't exist - if the [`PropertyObjectWithMetadata`] is not valid with respect to the specified [`EntityType`] - if the account referred to by `web_id` does not exist - if an [`EntityUuid`] was supplied and already exists in the store [`EntityType`]: type_system::ontology::entity_type::EntityType
(
&mut self,
actor_id: ActorEntityUuid,
params: CreateEntityParams,
)
| 698 | /// |
| 699 | /// [`EntityType`]: type_system::ontology::entity_type::EntityType |
| 700 | fn create_entity( |
| 701 | &mut self, |
| 702 | actor_id: ActorEntityUuid, |
| 703 | params: CreateEntityParams, |
| 704 | ) -> impl Future<Output = Result<Entity, Report<InsertionError>>> + Send { |
| 705 | self.create_entities(actor_id, vec![params]) |
| 706 | .map_ok(|mut entities| { |
| 707 | let entity = entities.pop().expect("Expected a single entity"); |
| 708 | assert!(entities.is_empty(), "Expected a single entity"); |
| 709 | entity |
| 710 | }) |
| 711 | } |
| 712 | |
| 713 | /// Creates new [`Entities`][Entity]. |
| 714 | fn create_entities( |