Struct RunCommand

Source
pub struct RunCommand<TParameter, TResponse> { /* private fields */ }
Expand description

The RunCommand is a query request that will run a named command with a parameter, returning the result as a stream of responses to a target

Implementations§

Source§

impl<TParameter, TResponse> RunCommand<TParameter, TResponse>
where TParameter: Unpin + Send, TResponse: Unpin + Send,

Source

pub fn new( target: impl Into<StreamTarget>, name: impl Into<String>, parameter: impl Into<TParameter>, ) -> Self

Creates a new ‘run command’ request. The command with the specified name will be run, and will send its response to the target.

Source

pub fn target(&self) -> StreamTarget

Returns the program that the response to the command should be setn to

Source

pub fn name(&self) -> &str

The name of the command that is to be run

Source

pub fn parameter(&self) -> &TParameter

The parameter to the command

Trait Implementations§

Source§

impl<TParameter: Clone, TResponse: Clone> Clone for RunCommand<TParameter, TResponse>

Source§

fn clone(&self) -> RunCommand<TParameter, TResponse>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<TParameter: Debug, TResponse: Debug> Debug for RunCommand<TParameter, TResponse>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de, TParameter, TResponse> Deserialize<'de> for RunCommand<TParameter, TResponse>
where TParameter: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<TParameter: PartialEq, TResponse: PartialEq> PartialEq for RunCommand<TParameter, TResponse>

Source§

fn eq(&self, other: &RunCommand<TParameter, TResponse>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<TParameter, TResponse> QueryRequest for RunCommand<TParameter, TResponse>
where for<'de> TParameter: 'static + Unpin + Send + Serialize + Deserialize<'de>, for<'de> TResponse: 'static + Unpin + Send + Serialize + Deserialize<'de>,

Source§

type ResponseData = TResponse

An object receiving this query request will send back a QueryResponse<Self::ResponseData>
Source§

fn with_new_target(self, new_target: StreamTarget) -> Self

Updates this request to use a different target
Source§

impl<TParameter, TResponse> SceneMessage for RunCommand<TParameter, TResponse>
where for<'de> TParameter: 'static + Unpin + Send + Serialize + Deserialize<'de>, for<'de> TResponse: 'static + Unpin + Send + Serialize + Deserialize<'de>,

Source§

fn message_type_name() -> String

A string that identifies this message type uniquely when serializing Read more
Source§

fn default_target() -> StreamTarget

The default target for this message type Read more
Source§

fn initialise(init_context: &impl SceneInitialisationContext)

Sets up this message type in a scene. This can be an opportunity to set up default filters and connections for a particular message type. This is called the first time that a message is referenced in a scene.
Source§

fn allow_thread_stealing_by_default() -> bool

True if input streams for this message type should allow thread stealing by default Read more
Source§

fn serializable() -> bool

True if this message supports serialization Read more
Source§

impl<TParameter, TResponse> Serialize for RunCommand<TParameter, TResponse>
where TParameter: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<TParameter: Eq, TResponse: Eq> Eq for RunCommand<TParameter, TResponse>

Source§

impl<TParameter, TResponse> StructuralPartialEq for RunCommand<TParameter, TResponse>

Auto Trait Implementations§

§

impl<TParameter, TResponse> Freeze for RunCommand<TParameter, TResponse>
where TParameter: Freeze,

§

impl<TParameter, TResponse> !RefUnwindSafe for RunCommand<TParameter, TResponse>

§

impl<TParameter, TResponse> Send for RunCommand<TParameter, TResponse>
where TParameter: Send, TResponse: Send,

§

impl<TParameter, TResponse> Sync for RunCommand<TParameter, TResponse>
where TParameter: Sync, TResponse: Send,

§

impl<TParameter, TResponse> Unpin for RunCommand<TParameter, TResponse>
where TParameter: Unpin, TResponse: Unpin,

§

impl<TParameter, TResponse> !UnwindSafe for RunCommand<TParameter, TResponse>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,