Skip to main content

Class

Struct Class 

Source
pub struct Class<M: Model> { /* private fields */ }
Expand description

A class of a server, through which its devices reach its definition and the properties the database holds for it.

Implementations§

Source§

impl<M: Model> Class<M>

Source

pub fn name(&self) -> &str

The name of that class.

Source

pub fn server(&self) -> &Server

The server this class is defined in.

Source

pub async fn list_prop_async(&self, filter: &str) -> Result<Spectrum<str>>

The names of the properties of this class that match the given filter.

Source

pub fn list_prop(&self, filter: &str) -> Result<Spectrum<str>>

The names of the properties of this class, see Self::list_prop_async.

Source

pub fn get_prop_async<Spec, Names: ToNames>( &self, names: Names, ) -> impl Future<Output = Result<Spec::Output>> + Send
where Spec: GetPropSpec<Names>,

The properties of this class, parsed into the shape the given names ask for, see crate::database::DatabaseProxy::get_class_prop.

Source

pub fn get_prop<Spec, Names: ToNames>( &self, names: Names, ) -> Result<Spec::Output>
where Spec: GetPropSpec<Names>,

The properties of this class, see Self::get_prop_async.

Source

pub fn set_prop_async<'a, Spec>( &'a self, spec: Spec, ) -> impl Future<Output = Result<()>> + Send
where Spec: SetPropSpec<'a>,

Write the given properties of this class.

Source

pub fn set_prop<'a, Spec>(&'a self, spec: Spec) -> Result<()>
where Spec: SetPropSpec<'a>,

Write the given properties of this class, see Self::set_prop_async.

Source

pub fn delete_prop_async<Names: ToNamesNotAll>( &self, names: Names, ) -> impl Future<Output = Result<()>> + Send

Delete the given properties of this class.

Source

pub fn delete_prop<Names: ToNamesNotAll>(&self, names: Names) -> Result<()>

Delete the given properties of this class, see Self::delete_prop_async.

Source

pub fn def(&self) -> &ClassDef<M>

The definition of that class.

Source

pub fn add_dev(&self, name: &str) -> Result<Arc<Dev<M>>>

Add a device of that class to the server, whose name has to be a valid domain/family/member one, see name::check_tango_dev_name, and unique server-wide.

The device is only registered: it is initialized, served and exported by the next Server::sync_async.

Trait Implementations§

Source§

impl<M: Model> Debug for Class<M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<M> !Freeze for Class<M>

§

impl<M> !RefUnwindSafe for Class<M>

§

impl<M> !UnwindSafe for Class<M>

§

impl<M> Forget for Class<M>

§

impl<M> Send for Class<M>
where Weak<Class<M>>: Send, Arc<ClassDef<M>>: Send,

§

impl<M> Sync for Class<M>
where Weak<Class<M>>: Sync, Arc<ClassDef<M>>: Sync,

§

impl<M> Unpin for Class<M>
where Weak<Class<M>>: Unpin, Arc<ClassDef<M>>: Unpin,

§

impl<M> UnsafeUnpin for Class<M>

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Model for T
where T: Send + Sync + 'static,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more