Struct v11::Universe [−][src]
pub struct Universe { pub event_handlers: EventHandlers, // some fields omitted }
A context object whose reference should be passed around everywhere.
Fields
event_handlers: EventHandlers
Methods
impl Universe
[src]
impl Universe
Domain introspection methods.
pub fn get_domains(domains: &[DomainName]) -> Vec<MaybeDomain>
[src]
pub fn get_domains(domains: &[DomainName]) -> Vec<MaybeDomain>
pub fn add_domain(&mut self, domain: DomainName)
[src]
pub fn add_domain(&mut self, domain: DomainName)
pub fn add_properties(&mut self)
[src]
pub fn add_properties(&mut self)
Adds any properties that are unknown. This function should be called if any libraries have been loaded since before the universe was created.
pub fn get_domain_names(&self) -> Vec<DomainName>
[src]
pub fn get_domain_names(&self) -> Vec<DomainName>
Return a list of the names of all registered domains.
impl Universe
[src]
impl Universe
Property manipulation methods.
pub fn get<V: Any + Sync + Copy>(&self, prop: &ToPropRef<V>) -> V
[src]
pub fn get<V: Any + Sync + Copy>(&self, prop: &ToPropRef<V>) -> V
Returns a copy of the value of the given property. Only works for properties that are Copy
.
pub fn set<V: Any + Sync>(&self, prop: &ToPropRef<V>, val: V)
[src]
pub fn set<V: Any + Sync>(&self, prop: &ToPropRef<V>, val: V)
Sets the value of a property.
pub fn swap<V: Any + Sync>(&self, prop: &ToPropRef<V>, val: V) -> V
[src]
pub fn swap<V: Any + Sync>(&self, prop: &ToPropRef<V>, val: V) -> V
Exchange the value in a property.
pub fn read<V: Any + Sync>(&self, prop: &ToPropRef<V>) -> RwLockReadGuard<V>
[src]
pub fn read<V: Any + Sync>(&self, prop: &ToPropRef<V>) -> RwLockReadGuard<V>
Gets the property locked for reading. Panics if poisoned.
pub fn write<V: Any + Sync>(&self, prop: &ToPropRef<V>) -> RwLockWriteGuard<V>
[src]
pub fn write<V: Any + Sync>(&self, prop: &ToPropRef<V>) -> RwLockWriteGuard<V>
Gets the property locked for writing. Panics if poisoned.
impl Universe
[src]
impl Universe
pub fn register_tracker<R: Tracker>(&self, tracker: R)
[src]
pub fn register_tracker<R: Tracker>(&self, tracker: R)
Add a custom tracker.
You'll typically use this to maintain consistentcy with non-table data structures.
For tables you'll generally use #[foreign]
to be provided a struct to implement
Tracker
on. Such trackers are automatically added to each table instance; this
function adds the tracker only to a particular instance.
impl Universe
[src]
impl Universe
Universe manipulation methods.
pub fn new(domains: &[DomainName]) -> Universe
[src]
pub fn new(domains: &[DomainName]) -> Universe
pub fn guard(self) -> GuardedUniverse
[src]
pub fn guard(self) -> GuardedUniverse
Converts to a form shareable with other threads.
pub fn info(&self) -> String
[src]
pub fn info(&self) -> String
Returns a string describing all the tables in the Universe. (This does not include their contents.)
Trait Implementations
impl<'a, V: Any + Sync> Index<&'a ToPropRef<V>> for Universe
[src]
impl<'a, V: Any + Sync> Index<&'a ToPropRef<V>> for Universe
type Output = RwLock<V>
The returned type after indexing.
fn index(&self, prop: &'a ToPropRef<V>) -> &RwLock<V>
[src]
fn index(&self, prop: &'a ToPropRef<V>) -> &RwLock<V>
Performs the indexing (container[index]
) operation.
impl Debug for Universe
[src]
impl Debug for Universe