Skip to main content

Conversation

Struct Conversation 

Source
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: Conversation

Methods from Deref<Target = Conversation>§

Source

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.

Source

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.

Source

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.

Source

pub fn messages(&self) -> &[Arc<Message>]

The messages, oldest first: what a request sends.

Source

pub fn entries(&self) -> impl DoubleEndedIterator + ExactSizeIterator

The entries, oldest first.

Source

pub fn entry(&self, at: usize) -> Option<Entry>

Entry at, with its author, id and when it was made, to splice back changed.

Source

pub fn id(&self, at: usize) -> Option<MessageId>

The id of entry at.

Source

pub fn key(&self, at: usize) -> Option<MessageKey>

The identity of entry at beyond this conversation.

Source

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.

Source

pub fn author(&self, at: usize) -> Option<&Author>

Who wrote entry at; None for the user’s own text, the model’s reply, a tool result, or no such entry.

Source

pub fn index_of(&self, id: MessageId) -> Option<usize>

Where entry id is now; None once an edit took it out.

Source

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.

Source

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.

Source

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.

Source

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).

Source

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.

Source

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.

Source

pub fn pending_calls(&self) -> Vec<ToolCall>

The tool calls of the last assistant message that nothing answers yet. See pairing::pending_calls.

Source

pub fn validate(&self) -> Result<(), PairingError>

Whether the messages pair every tool call with its result. See pairing::validate.

Source

pub fn asides(&self) -> impl DoubleEndedIterator

The asides, in the order put.

Source

pub fn aside(&self, id: AsideId) -> Option<&Aside>

Aside id.

Source

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).

Source

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.

Source

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.

Source

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.

Source

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));
Source

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.

Source

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);
Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn remove_aside(&mut self, id: AsideId) -> Option<Aside>

Removes aside id and returns it, or None if there was none.

Source

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.

Source

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));
Source

pub fn unsaved(&self) -> &[ChangeRecord]

The changes made that nobody has saved yet, oldest first.

Source

pub fn take_unsaved(&mut self) -> Vec<ChangeRecord>

Takes the changes made that nobody has saved yet, to save them.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn view(&self) -> Conversation

A copy with an empty outbox, for edits never saved (a preview, a reset’s state).

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Component for Conversation
where Self: Send + Sync + 'static,

Source§

const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table

A constant indicating the storage type used for this component.
Source§

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

fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )

Registers required components. Read more
Source§

fn on_discard() -> Option<ComponentHook>

Gets the on_discard ComponentHook for this Component if one is defined.
Source§

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 relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>

Returns ComponentRelationshipAccessor required for working with relationships in dynamic contexts. Read more
Source§

fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>

Gets the on_add ComponentHook for this Component if one is defined.
Source§

fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>

Gets the on_insert ComponentHook for this Component if one is defined.
Source§

fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>

Gets the on_remove ComponentHook for this Component if one is defined.
Source§

fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>

Gets the on_despawn ComponentHook for this Component if one is defined.
Source§

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

const HAS_SUMMARY_TICK: bool = false

Set this constant to true if the component should track a summary tick. Read more
Source§

impl Debug for Conversation

Source§

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

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

impl Default for Conversation

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Deref for Conversation

Source§

type Target = Conversation

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for Conversation

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'de> Deserialize<'de> for Conversation

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 From<Conversation> for Conversation

Source§

fn from(conversation: Conversation) -> Self

Converts to this type from the input type.
Source§

impl FromReflect for Conversation

Source§

fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>

Constructs a concrete instance of Self from a reflected value.
Source§

fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>

Attempts to downcast the given value to Self using, constructing the value using from_reflect if that fails. Read more
Source§

impl GetTypeRegistration for Conversation

Source§

fn get_type_registration() -> TypeRegistration

Returns the default TypeRegistration for this type.
Source§

fn register_type_dependencies(_registry: &mut TypeRegistry)

Registers other types needed by this type. Read more
Source§

impl PartialEq for Conversation

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialReflect for Conversation

Source§

fn get_represented_type_info(&self) -> Option<&'static TypeInfo>

Returns the TypeInfo of the type represented by this value. Read more
Source§

fn to_dynamic(&self) -> Result<Box<dyn PartialReflect>, ReflectCloneError>

Converts this reflected value into its dynamic representation based on its kind. Read more
Source§

fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>

Tries to apply a reflected value to this value. Read more
Source§

fn reflect_kind(&self) -> ReflectKind

Returns a zero-sized enumeration of “kinds” of type. Read more
Source§

fn reflect_ref(&self) -> ReflectRef<'_>

Returns an immutable enumeration of “kinds” of type. Read more
Source§

fn reflect_mut(&mut self) -> ReflectMut<'_>

Returns a mutable enumeration of “kinds” of type. Read more
Source§

fn reflect_owned(self: Box<Self>) -> ReflectOwned

Returns an owned enumeration of “kinds” of type. Read more
Source§

fn try_into_reflect( self: Box<Self>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>

Attempts to cast this type to a boxed, fully-reflected value.
Source§

fn try_as_reflect(&self) -> Option<&dyn Reflect>

Attempts to cast this type to a fully-reflected value.
Source§

fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>

Attempts to cast this type to a mutable, fully-reflected value.
Source§

fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>

Casts this type to a boxed, reflected value. Read more
Source§

fn as_partial_reflect(&self) -> &dyn PartialReflect

Casts this type to a reflected value. Read more
Source§

fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect

Casts this type to a mutable, reflected value. Read more
Source§

fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>

Attempts to clone Self using reflection. Read more
Source§

fn apply(&mut self, value: &(dyn PartialReflect + 'static))

Applies a reflected value to this value. Read more
Source§

fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
where T: 'static, Self: Sized + TypePath,

For a type implementing 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>

Returns a hash of the value (which includes the type). Read more
Source§

fn reflect_partial_eq( &self, _value: &(dyn PartialReflect + 'static), ) -> Option<bool>

Returns a “partial equality” comparison result. Read more
Source§

fn reflect_partial_cmp( &self, _value: &(dyn PartialReflect + 'static), ) -> Option<Ordering>

Returns a “partial comparison” result. Read more
Source§

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

Debug formatter for the value. Read more
Source§

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
Source§

impl Reflect for Conversation

Source§

fn into_any(self: Box<Self>) -> Box<dyn Any>

Returns the value as a Box<dyn Any>. Read more
Source§

fn as_any(&self) -> &dyn Any

Returns the value as a &dyn Any. Read more
Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Returns the value as a &mut dyn Any. Read more
Source§

fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>

Casts this type to a boxed, fully-reflected value.
Source§

fn as_reflect(&self) -> &dyn Reflect

Casts this type to a fully-reflected value.
Source§

fn as_reflect_mut(&mut self) -> &mut dyn Reflect

Casts this type to a mutable, fully-reflected value.
Source§

fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>

Performs a type-checked assignment of a reflected value to this value. Read more
Source§

impl Serialize for Conversation

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 StructuralPartialEq for Conversation

Source§

impl TypePath for Conversation

Source§

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
Source§

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
Source§

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
Source§

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
Source§

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
Source§

impl Typed for Conversation

Source§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.

Auto Trait Implementations§

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<C> Bundle for C
where C: Component,

Source§

fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>

Source§

fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>

Returns an iterator over this Bundle’s component ids. This will be None if the component has not been registered.
Source§

impl<C> BundleFromComponents for C
where C: Component,

Source§

unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> C
where F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a>, C: Sized,

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> ConditionalSend for T
where T: Send,

Source§

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

Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<C> DynamicBundle for C
where C: Component,

Source§

type Effect = ()

An operation on the entity that happens after inserting this bundle.
Source§

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<'_>, )

Applies the after-effects of spawning this bundle. Read more
Source§

impl<T> DynamicTypePath for T
where T: TypePath,

Source§

impl<T> DynamicTyped for T
where T: Typed,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromTemplate for T
where T: Clone + Default + Unpin,

Source§

type Template = T

The Template for this type.
Source§

impl<T> FromWorld for T
where T: Default,

Source§

fn from_world(_world: &mut World) -> T

Creates Self using default().

Source§

impl<T> GetPath for T
where T: Reflect + ?Sized,

Source§

fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a reference to the value specified by path. Read more
Source§

fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a mutable reference to the value specified by path. Read more
Source§

fn path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed reference to the value specified by path. Read more
Source§

fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed mutable reference to the value specified by path. Read more
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> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<T> IntoToolOutput for T
where T: Serialize + 'static,

Source§

fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>

Convert this value without routing structured data through a string.
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Reflectable for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> Template for T
where T: Clone + Unpin,

Source§

type Output = T

The type of value produced by this Template.
Source§

fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>

Uses this template and the given entity context to produce a Template::Output.
Source§

fn clone_template(&self) -> T

Clones this template. See Clone.
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 = !

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> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of self.
Source§

impl<T> WasmCompatSend for T
where T: Send,

Source§

impl<T> WasmCompatSync for T
where T: Sync,

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