pub struct Conversation(pub Conversation);Expand description
The agent’s conversation: rig-core’s
Conversation, which it derefs to, so a
plugin reads and changes it with that type’s methods. Requests send it as
it is.
Each change waits in the conversation’s outbox until the kernel saves it
and announces it as a
ConversationChanged. A value
inserted in place of the agent’s own is saved as one reset, after the
changes the old one had not saved. Saved through serde.
use rig_ecs::prelude::*;
// `/undo`: the user's last message and everything after it go.
fn undo(mut agents: Query<&mut Conversation, With<Agent>>) {
for mut conversation in &mut agents {
let last = conversation.entries().rev().find(|entry| entry.is_users_own());
if let Some(last) = last.map(|entry| entry.index) {
conversation.splice(last.., [], Author::plugin("undo"));
}
}
}Tuple Fields§
§0: ConversationMethods from Deref<Target = Conversation>§
Sourcepub fn turns(&self) -> impl DoubleEndedIterator
pub fn turns(&self) -> impl DoubleEndedIterator
The turn records, oldest first, with their asides’ ids; the newest
is turns().next_back(), found from the end.
Sourcepub fn open_turn(&mut self) -> TurnRecord
pub fn open_turn(&mut self) -> TurnRecord
Records a turn that begins now, numbered after the last record and
starting at turn_start. Returns the new record.
Sourcepub fn end_turn(&mut self, end: TurnEnd) -> bool
pub fn end_turn(&mut self, end: TurnEnd) -> bool
Ends the last turn record, when it is open, with end. Returns
whether it was open.
Sourcepub fn entries(&self) -> impl DoubleEndedIterator + ExactSizeIterator
pub fn entries(&self) -> impl DoubleEndedIterator + ExactSizeIterator
The entries, oldest first.
Sourcepub fn entry(&self, at: usize) -> Option<Entry>
pub fn entry(&self, at: usize) -> Option<Entry>
Entry at, with its author, id and when it was made, to splice
back changed.
Sourcepub fn key(&self, at: usize) -> Option<MessageKey>
pub fn key(&self, at: usize) -> Option<MessageKey>
The identity of entry at beyond this conversation.
Sourcepub fn index_of_key(&self, key: MessageKey) -> Option<usize>
pub fn index_of_key(&self, key: MessageKey) -> Option<usize>
Where the entry with identity key is now; None when it is not
here, also when an entry with its id was made at another time.
Who wrote entry at; None for the user’s own text, the model’s
reply, a tool result, or no such entry.
Sourcepub fn index_of(&self, id: MessageId) -> Option<usize>
pub fn index_of(&self, id: MessageId) -> Option<usize>
Where entry id is now; None once an edit took it out.
Sourcepub fn start_of(&self, id: MessageId) -> usize
pub fn start_of(&self, id: MessageId) -> usize
Where a span that began at entry id begins now, such as a turn:
its index while it is there; the end for an entry not made yet; 0
for one an edit took out, as a summary then stands for what came
before it.
Sourcepub fn turn_start(&self) -> MessageId
pub fn turn_start(&self) -> MessageId
Where a turn starting now begins: the first of the user messages at the end, which it answers, else the first entry it adds.
Sourcepub fn asked(&self, start: MessageId) -> impl Iterator<Item = EntryRef<'_>>
pub fn asked(&self, start: MessageId) -> impl Iterator<Item = EntryRef<'_>>
The entries a turn that began at start (its
turn_start) answers: the user messages in a
row from where it begins now (start_of). After a
stopped turn they begin with that turn’s tool results and the
STOPPED note, before what was sent next.
Sourcepub fn request(&self, start: MessageId) -> Option<EntryRef<'_>>
pub fn request(&self, start: MessageId) -> Option<EntryRef<'_>>
The message that asked for the turn that began at start: the
first of the entries it answers (asked) that is a
request (EntryRef::is_request).
Sourcepub fn halted(&self) -> Option<Halt>
pub fn halted(&self) -> Option<Halt>
Why the user’s last message is left unanswered, if it was halted. Cleared when an entry is pushed or a splice reaches the end.
Sourcepub fn awaits_model(&self) -> bool
pub fn awaits_model(&self) -> bool
Whether the model owes an answer: the last message a model reads is
the user’s, and it was not halted. A failed or stopped reply after it
is never read (StopReason::is_failure), so the answer is still
owed.
Sourcepub fn pending_calls(&self) -> Vec<ToolCall>
pub fn pending_calls(&self) -> Vec<ToolCall>
The tool calls of the last assistant message that nothing answers
yet. See pairing::pending_calls.
Sourcepub fn validate(&self) -> Result<(), PairingError>
pub fn validate(&self) -> Result<(), PairingError>
Whether the messages pair every tool call with its result. See
pairing::validate.
Sourcepub fn asides(&self) -> impl DoubleEndedIterator
pub fn asides(&self) -> impl DoubleEndedIterator
The asides, in the order put.
Sourcepub fn aside_position(&self, aside: &Aside) -> usize
pub fn aside_position(&self, aside: &Aside) -> usize
Where aside is drawn: before entry position, after entry
position - 1. While an edit took out the entry it follows, after
the entry that stands for it now (start_of).
Sourcepub fn push(&mut self, entry: impl Into<Entry>) -> MessageId
pub fn push(&mut self, entry: impl Into<Entry>) -> MessageId
Pushes entry, after a STOPPED entry by Author::rig in the
same change when the user stopped the last request; a halt is
cleared. Returns the new entry’s id; a pushed entry never reuses one.
Sourcepub fn extend(
&mut self,
messages: impl IntoIterator<Item = impl Into<Arc<Message>>>,
)
pub fn extend( &mut self, messages: impl IntoIterator<Item = impl Into<Arc<Message>>>, )
Pushes each of messages as its own entry without an author, in one
change, as push does.
Sourcepub fn splice(
&mut self,
range: impl RangeBounds<usize>,
with: impl IntoIterator<Item = Entry>,
by: Author,
) -> Spliced
pub fn splice( &mut self, range: impl RangeBounds<usize>, with: impl IntoIterator<Item = Entry>, by: Author, ) -> Spliced
Replaces entries in range, clamped to the conversation, with
with, recorded as made by by. An entry of with keeps its id
when that id was in the range and no earlier entry of with kept
it; any other gets a new id. Nothing merges. A splice reaching the
end clears the halt. An empty range replaced by nothing changes and
records nothing.
Sourcepub fn restore(
&mut self,
range: impl RangeBounds<usize>,
with: impl IntoIterator<Item = Entry>,
by: Author,
) -> Spliced
pub fn restore( &mut self, range: impl RangeBounds<usize>, with: impl IntoIterator<Item = Entry>, by: Author, ) -> Spliced
As splice, and an entry of with whose id this
conversation made (below the next id), that no entry outside the
range holds and no earlier entry of with took, keeps that id and
when it was made (Entry::made, else now): entries put back as
they were, such as a summary’s originals or an edit undone. Asides that followed such an entry follow it again.
Only for entries this conversation held: an entry from elsewhere
that carries an id would take one that meant another message here.
use rig_core::completion::Message;
use rig_core::conversation::{Author, Conversation, Entry};
let mut conversation = Conversation::from_messages([
Message::user("one"),
Message::assistant("two"),
]);
let ids: Vec<_> = conversation.entries().map(|entry| entry.id).collect();
let originals: Vec<Entry> = (0..2).filter_map(|at| conversation.entry(at)).collect();
let summary = Entry::new(Message::user("a summary"));
conversation.splice(.., [summary], Author::plugin("compact"));
let undone = conversation.restore(.., originals, Author::plugin("undo"));
assert_eq!(undone.restored, ids);
assert!(conversation.entries().map(|entry| entry.id).eq(ids));Sourcepub fn set_entries(&mut self, entries: Vec<Entry>, by: Author) -> Spliced
pub fn set_entries(&mut self, entries: Vec<Entry>, by: Author) -> Spliced
Makes the conversation hold entries, as made by by: one
restore of the range between the longest start
and end it shares with them (the same messages, ids and authors), so
entries taken from it keep their ids. Nothing when they are equal.
Sourcepub fn edit_each(
&mut self,
by: Author,
edit: impl FnMut(EntryRef<'_>) -> Option<Message>,
) -> Vec<MessageId>
pub fn edit_each( &mut self, by: Author, edit: impl FnMut(EntryRef<'_>) -> Option<Message>, ) -> Vec<MessageId>
Rewrites entries in place, as made by by: edit sees each entry,
oldest first, and returns the message to put in its place, or
None to leave it. The entries it rewrote keep their ids and
authors, and the whole edit is one change: a splice
of the entries from the first rewritten to the last. Nothing is
recorded when it rewrote none. Returns the ids of the entries it
rewrote.
use rig_core::completion::Message;
use rig_core::conversation::{Author, Conversation};
let mut conversation = Conversation::from_messages([
Message::user("one"),
Message::user("two"),
]);
let before = conversation.id(1);
let changed = conversation.edit_each(Author::plugin("shout"), |entry| {
(entry.index == 1).then(|| Message::user("TWO"))
});
assert_eq!(changed, before.into_iter().collect::<Vec<_>>());
assert_eq!(conversation.messages().get(1).map(|message| &**message), Some(&Message::user("TWO")));
assert_eq!(conversation.id(1), before);Sourcepub fn normalize(&mut self, by: Author) -> Normalized
pub fn normalize(&mut self, by: Author) -> Normalized
Repairs the entries as pairing::normalize does, saved with
set_entries as made by by, so merged
entries keep the first’s id, author and made-time. An aside that
followed an entry merged into another follows that one; one that
followed a dropped entry follows the entry before it (each move
recorded, by by). Returns what it repaired.
Sourcepub fn reread(&mut self, from_log: Conversation) -> Result<(), ApplyError>
pub fn reread(&mut self, from_log: Conversation) -> Result<(), ApplyError>
Takes everything a log holds from from_log, a value read from that
log: entries, saved asides, halt, next ids, lineage and revision.
This value’s unsaved asides stay, with their ids. For a host whose
log was rewritten under the value it holds.
§Errors
ApplyError::Mismatch, changing nothing, while either value has
unsaved changes, or when an unsaved aside’s id is a saved one’s in
from_log.
Sourcepub fn halt(&mut self, halt: Halt) -> bool
pub fn halt(&mut self, halt: Halt) -> bool
Leaves the user’s last message unanswered, for halt. Whether it
was halted now: not when the model owes no answer.
Sourcepub fn resume(&mut self) -> bool
pub fn resume(&mut self) -> bool
Asks the model again for an answer to the user’s last message, also a halted one; whether the last message is the user’s.
Sourcepub fn add_aside(&mut self, aside: Aside) -> AsideId
pub fn add_aside(&mut self, aside: Aside) -> AsideId
Puts aside after the asides already put and returns its id. An
unsaved aside is not recorded.
Sourcepub fn replace_aside(&mut self, id: AsideId, aside: Aside) -> bool
pub fn replace_aside(&mut self, id: AsideId, aside: Aside) -> bool
Replaces aside id with aside, in its place; whether there was
one. Replacing a saved aside with an unsaved one records its
removal.
Sourcepub fn remove_aside(&mut self, id: AsideId) -> Option<Aside>
pub fn remove_aside(&mut self, id: AsideId) -> Option<Aside>
Removes aside id and returns it, or None if there was none.
Sourcepub fn apply(&mut self, change: &ChangeRecord) -> Result<(), ApplyError>
pub fn apply(&mut self, change: &ChangeRecord) -> Result<(), ApplyError>
Applies a recorded change verbatim, such as one read from a log or sent by a process that mirrors this conversation. It is not put in the outbox. Fails, changing nothing, when it does not fit.
Sourcepub fn dated<R>(
&mut self,
at: u64,
edit: impl FnOnce(&mut Conversation) -> R,
) -> R
pub fn dated<R>( &mut self, at: u64, edit: impl FnOnce(&mut Conversation) -> R, ) -> R
Makes the edits of edit as made at at, in milliseconds since the
Unix epoch, such as messages imported at the times their source
logged them: their records carry that time, which a writer keeps,
and the entries they make were made then. An edit dated inside, by a
nested call, keeps its own time.
use rig_core::conversation::Conversation;
use rig_core::message::Message;
let mut conversation = Conversation::new();
conversation.dated(1_790_848_800_000, |conversation| {
conversation.push(Message::user("Imported"))
});
let at = conversation.unsaved().first().and_then(|recorded| recorded.at);
assert_eq!(at, Some(1_790_848_800_000));Sourcepub fn unsaved(&self) -> &[ChangeRecord]
pub fn unsaved(&self) -> &[ChangeRecord]
The changes made that nobody has saved yet, oldest first.
Sourcepub fn take_unsaved(&mut self) -> Vec<ChangeRecord>
pub fn take_unsaved(&mut self) -> Vec<ChangeRecord>
Takes the changes made that nobody has saved yet, to save them.
Sourcepub fn revision(&self) -> u64
pub fn revision(&self) -> u64
The changes behind this value, one per record: those of the log it
continues (lineage) when it was last loaded or
saved, then each applied or made since. An unsaved aside counts
none.
Sourcepub fn lineage(&self) -> Lineage
pub fn lineage(&self) -> Lineage
The saved log this value continues: Lineage::EMPTY when it was
begun here from nothing and never saved, Lineage::DETACHED when
it was read back from its serde form.
Sourcepub fn continues(&self, lineage: Lineage, changes: u64) -> bool
pub fn continues(&self, lineage: Lineage, changes: u64) -> bool
Whether this value’s unsaved changes, appended to the log of
lineage that holds changes changes, give this value: it
continues that log, holding all of its changes and since then only
its unsaved ones. A value begun here from nothing continues any
empty log.
Sourcepub fn continue_log(&mut self, lineage: Lineage, changes: u64)
pub fn continue_log(&mut self, lineage: Lineage, changes: u64)
Marks this value as holding the changes changes of the log of
lineage, then its unsaved ones: what a store does once it loaded
the value from that log or saved it there.
Sourcepub fn view(&self) -> Conversation
pub fn view(&self) -> Conversation
A copy with an empty outbox, for edits never saved (a preview, a reset’s state).
Sourcepub fn request_view(&self) -> Conversation
pub fn request_view(&self) -> Conversation
A view without the asides, for a model request’s
copy: a request never sends them, and one is built per model call.
Trait Implementations§
Source§impl Clone for Conversation
impl Clone for Conversation
Source§impl Component for Conversation
impl Component for Conversation
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
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<'_, '_>, )
Source§fn on_discard() -> Option<ComponentHook>
fn on_discard() -> Option<ComponentHook>
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor required for working with relationships in dynamic contexts. Read moreSource§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_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,
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§const HAS_SUMMARY_TICK: bool = false
const HAS_SUMMARY_TICK: bool = false
Source§impl Debug for Conversation
impl Debug for Conversation
Source§impl Default for Conversation
impl Default for Conversation
Source§impl Deref for Conversation
impl Deref for Conversation
Source§impl DerefMut for Conversation
impl DerefMut for Conversation
Source§impl<'de> Deserialize<'de> for Conversation
impl<'de> Deserialize<'de> for Conversation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<Conversation> for Conversation
impl From<Conversation> for Conversation
Source§fn from(conversation: Conversation) -> Self
fn from(conversation: Conversation) -> Self
Source§impl FromReflect for Conversation
impl FromReflect for Conversation
Source§fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
Self from a reflected value.Source§fn take_from_reflect(
reflect: Box<dyn PartialReflect>,
) -> Result<Self, Box<dyn PartialReflect>>
fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>
Self using,
constructing the value using from_reflect if that fails. Read moreSource§impl GetTypeRegistration for Conversation
impl GetTypeRegistration for Conversation
Source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
TypeRegistration for this type.Source§fn register_type_dependencies(_registry: &mut TypeRegistry)
fn register_type_dependencies(_registry: &mut TypeRegistry)
Source§impl PartialEq for Conversation
impl PartialEq for Conversation
Source§impl PartialReflect for Conversation
impl PartialReflect for Conversation
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn to_dynamic(&self) -> Result<Box<dyn PartialReflect>, ReflectCloneError>
fn to_dynamic(&self) -> Result<Box<dyn PartialReflect>, ReflectCloneError>
Source§fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>
fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>
Source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn reflect_owned(self: Box<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
Source§fn try_into_reflect(
self: Box<Self>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<Self>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Source§fn try_as_reflect(&self) -> Option<&dyn Reflect>
fn try_as_reflect(&self) -> Option<&dyn Reflect>
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
Source§fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
Source§fn as_partial_reflect(&self) -> &dyn PartialReflect
fn as_partial_reflect(&self) -> &dyn PartialReflect
Source§fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
Source§fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
Self using reflection. Read moreSource§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Source§fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
PartialReflect, combines reflect_clone and
take in a useful fashion, automatically constructing an appropriate
ReflectCloneError if the downcast fails.Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn reflect_partial_eq(
&self,
_value: &(dyn PartialReflect + 'static),
) -> Option<bool>
fn reflect_partial_eq( &self, _value: &(dyn PartialReflect + 'static), ) -> Option<bool>
Source§fn reflect_partial_cmp(
&self,
_value: &(dyn PartialReflect + 'static),
) -> Option<Ordering>
fn reflect_partial_cmp( &self, _value: &(dyn PartialReflect + 'static), ) -> Option<Ordering>
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl Reflect for Conversation
impl Reflect for Conversation
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any. Read moreSource§fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
Source§fn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
Source§fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
Source§impl Serialize for Conversation
impl Serialize for Conversation
impl StructuralPartialEq for Conversation
Source§impl TypePath for Conversation
impl TypePath for Conversation
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Auto Trait Implementations§
impl Freeze for Conversation
impl RefUnwindSafe for Conversation
impl Send for Conversation
impl Sync for Conversation
impl Unpin for Conversation
impl UnsafeUnpin for Conversation
impl UnwindSafe for Conversation
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
Source§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = 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,
impl<T> ConditionalSend for Twhere
T: Send,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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)
&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)
&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
Source§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
Source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path.Source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name.Source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
Source§impl<T> DynamicTyped for Twhere
T: Typed,
impl<T> DynamicTyped for Twhere
T: Typed,
Source§fn reflect_type_info(&self) -> &'static TypeInfo
fn reflect_type_info(&self) -> &'static TypeInfo
Typed::type_info.Source§impl<T> FromTemplate for T
impl<T> FromTemplate for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T> GetPath for T
impl<T> GetPath for T
Source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§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>
Source§impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
impl<T> Reflectable for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.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>
self.