pub struct MqttClient { /* private fields */ }Expand description
A component that represents an MQTT client
Methods from Deref<Target = Client>§
Sourcepub fn publish<S, V>(
&self,
topic: S,
qos: QoS,
retain: bool,
payload: V,
) -> Result<(), ClientError>
pub fn publish<S, V>( &self, topic: S, qos: QoS, retain: bool, payload: V, ) -> Result<(), ClientError>
Sends a MQTT Publish to the EventLoop
pub fn try_publish<S, V>( &self, topic: S, qos: QoS, retain: bool, payload: V, ) -> Result<(), ClientError>
Sourcepub fn ack(&self, publish: &Publish) -> Result<(), ClientError>
pub fn ack(&self, publish: &Publish) -> Result<(), ClientError>
Sends a MQTT PubAck to the EventLoop. Only needed in if manual_acks flag is set.
Sourcepub fn try_ack(&self, publish: &Publish) -> Result<(), ClientError>
pub fn try_ack(&self, publish: &Publish) -> Result<(), ClientError>
Sends a MQTT PubAck to the EventLoop. Only needed in if manual_acks flag is set.
Sourcepub fn subscribe<S>(&self, topic: S, qos: QoS) -> Result<(), ClientError>
pub fn subscribe<S>(&self, topic: S, qos: QoS) -> Result<(), ClientError>
Sends a MQTT Subscribe to the EventLoop
Sourcepub fn try_subscribe<S>(&self, topic: S, qos: QoS) -> Result<(), ClientError>
pub fn try_subscribe<S>(&self, topic: S, qos: QoS) -> Result<(), ClientError>
Sends a MQTT Subscribe to the EventLoop
Sourcepub fn subscribe_many<T>(&self, topics: T) -> Result<(), ClientError>where
T: IntoIterator<Item = SubscribeFilter>,
pub fn subscribe_many<T>(&self, topics: T) -> Result<(), ClientError>where
T: IntoIterator<Item = SubscribeFilter>,
Sends a MQTT Subscribe for multiple topics to the EventLoop
pub fn try_subscribe_many<T>(&self, topics: T) -> Result<(), ClientError>where
T: IntoIterator<Item = SubscribeFilter>,
Sourcepub fn unsubscribe<S>(&self, topic: S) -> Result<(), ClientError>
pub fn unsubscribe<S>(&self, topic: S) -> Result<(), ClientError>
Sends a MQTT Unsubscribe to the EventLoop
Sourcepub fn try_unsubscribe<S>(&self, topic: S) -> Result<(), ClientError>
pub fn try_unsubscribe<S>(&self, topic: S) -> Result<(), ClientError>
Sends a MQTT Unsubscribe to the EventLoop
Sourcepub fn disconnect(&self) -> Result<(), ClientError>
pub fn disconnect(&self) -> Result<(), ClientError>
Sends a MQTT disconnect to the EventLoop
Sourcepub fn try_disconnect(&self) -> Result<(), ClientError>
pub fn try_disconnect(&self) -> Result<(), ClientError>
Sends a MQTT disconnect to the EventLoop
Trait Implementations§
Source§impl Clone for MqttClient
impl Clone for MqttClient
Source§fn clone(&self) -> MqttClient
fn clone(&self) -> MqttClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Component for MqttClient
impl Component for MqttClient
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
A constant indicating the storage type used for this component.
Source§type Mutability = Mutable
type Mutability = Mutable
A marker type to assist Bevy with determining if this component is
mutable, or immutable. Mutable components will have
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Registers required components. Read more
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Called when registering this component, allowing to override clone function (or disable cloning altogether) for this component. Read more
Source§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_replace() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_replace() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
Maps the entities on this component using the given
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§impl Deref for MqttClient
impl Deref for MqttClient
Auto Trait Implementations§
impl Freeze for MqttClient
impl RefUnwindSafe for MqttClient
impl Send for MqttClient
impl Sync for MqttClient
impl Unpin for MqttClient
impl UnwindSafe for MqttClient
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
Source§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ids: &mut impl FnMut(ComponentId), )
Source§fn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>),
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>), )
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
Source§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
Moves the components out of the bundle. Read more
Source§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
Applies the after-effects of spawning this bundle. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.