pub struct UserContext { /* private fields */ }Implementations§
Source§impl UserContext
impl UserContext
pub fn new() -> Self
pub fn user_identifier(&self) -> Option<&str>
pub fn set_user_identifier(&mut self, user_identifier: impl Into<String>)
pub fn with_user_identifier(self, user_identifier: impl Into<String>) -> Self
pub fn set_user_identifier_option(&mut self, user_identifier: Option<String>)
pub fn with_user_identifier_option( self, user_identifier: Option<String>, ) -> Self
pub fn with_module(self, module: RuntimeModule) -> Self
pub fn entity_root(&self) -> EntityRoot
pub fn initial_graphs(&self) -> &[GraphNode]
pub fn set_initial_graphs(&mut self, graphs: Vec<GraphNode>)
pub fn with_metadata(self, metadata: impl MetadataStore + 'static) -> Self
pub fn set_metadata(&mut self, metadata: impl MetadataStore + 'static)
pub fn with_repository_registry( self, registry: impl RepositoryRegistry + 'static, ) -> Self
pub fn set_repository_registry( &mut self, registry: impl RepositoryRegistry + 'static, )
pub fn with_repository_behavior_registry( self, registry: impl RepositoryBehaviorRegistry + 'static, ) -> Self
pub fn set_repository_behavior_registry( &mut self, registry: impl RepositoryBehaviorRegistry + 'static, )
pub fn with_request_policy(self, policy: impl RequestPolicy + 'static) -> Self
pub fn set_request_policy(&mut self, policy: impl RequestPolicy + 'static)
pub fn clear_request_policy(&mut self)
pub fn with_checker_registry( self, registry: impl CheckerRegistry + 'static, ) -> Self
pub fn set_checker_registry(&mut self, registry: impl CheckerRegistry + 'static)
pub fn with_event_sink(self, sink: impl EntityEventSink + 'static) -> Self
pub fn set_event_sink(&mut self, sink: impl EntityEventSink + 'static)
pub fn with_internal_id_generator( self, generator: impl InternalIdGenerator + 'static, ) -> Self
pub fn set_internal_id_generator( &mut self, generator: impl InternalIdGenerator + 'static, )
pub fn with_schema_provider( self, provider: impl SchemaProvider + 'static, ) -> Self
pub fn set_schema_provider(&mut self, provider: impl SchemaProvider + 'static)
pub async fn ensure_schema(&self) -> Result<(), RuntimeError>
pub fn with_language(self, language: Language) -> Self
pub fn set_language(&mut self, language: Language)
pub fn with_sql_log_options(self, options: SqlLogOptions) -> Self
pub fn set_sql_log_options(&mut self, options: SqlLogOptions)
pub fn enable_select_sql_log(&mut self)
pub fn enable_mutation_sql_log(&mut self)
pub fn enable_all_sql_log(&mut self)
pub fn disable_sql_log(&mut self)
pub fn sql_log_options(&self) -> SqlLogOptions
pub fn sql_logs(&self) -> Vec<SqlLogEntry>
pub fn clear_sql_logs(&self)
pub fn language(&self) -> Language
pub fn set_language_code(&mut self, code: &str) -> Result<(), RuntimeError>
pub fn generate_id(&self, entity: &str) -> Result<Option<u64>, RuntimeError>
pub fn next_id(&self, entity: &str) -> Result<u64, RuntimeError>
pub fn entity(&self, name: &str) -> Option<&EntityDescriptor>
pub fn all_entities(&self) -> Vec<&EntityDescriptor>
pub fn require_entity( &self, name: &str, ) -> Result<&EntityDescriptor, RuntimeError>
pub fn insert_resource<T>(&mut self, resource: T)
pub fn get_resource<T>(&self) -> Option<&T>
pub fn require_resource<T>(&self) -> Result<&T, ContextError>
pub fn insert_named_resource<T>(&mut self, name: impl Into<String>, resource: T)
pub fn get_named_resource<T>(&self, name: &str) -> Option<&T>
pub fn require_named_resource<T>(&self, name: &str) -> Result<&T, ContextError>
pub fn put_local(&mut self, key: impl Into<String>, value: impl Into<Value>)
pub fn local(&self, key: &str) -> Option<&Value>
pub fn remove_local(&mut self, key: &str) -> Option<Value>
pub fn has_repository(&self, entity: &str) -> bool
pub fn repository_behavior( &self, entity: &str, ) -> Option<Arc<dyn RepositoryBehavior>>
pub fn has_checker(&self, entity: &str) -> bool
pub fn check_and_fix_record( &self, entity: &str, record: &mut Record, ) -> Result<(), RuntimeError>
pub fn check_and_fix_record_at( &self, entity: &str, record: &mut Record, location: &ObjectLocation, ) -> Result<(), RuntimeError>
pub fn translate_check_results(&self, results: &mut CheckResults)
pub fn send_event(&self, event: EntityEvent) -> Result<(), RuntimeError>
pub fn commit_changes<D, E>(&self) -> Result<(), RepositoryError<E::Error>>
Source§impl UserContext
impl UserContext
pub fn repository<D, E>( &self, ) -> Result<ContextRepository<'_, D, E>, ContextError>
pub fn plan_for_save_graph<D, E>( &self, node: GraphNode, ) -> Result<GraphMutationPlan, RepositoryError<E::Error>>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for UserContext
impl !RefUnwindSafe for UserContext
impl Send for UserContext
impl Sync for UserContext
impl Unpin for UserContext
impl UnsafeUnpin for UserContext
impl !UnwindSafe for UserContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more