pub struct SystemRegion<K: BlockKind> { /* private fields */ }Expand description
One region of the system prompt: the blocks of one kind, in the order the layout gives them.
Implementations§
Source§impl<K: BlockKind> SystemRegion<K>
impl<K: BlockKind> SystemRegion<K>
Sourcepub fn remove(&mut self, slot: &Slot<K>) -> Option<K::Content>
pub fn remove(&mut self, slot: &Slot<K>) -> Option<K::Content>
Removes the block in slot, together with any staged replacement.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&Slot<K>, &K::Content)>
pub fn iter(&self) -> impl Iterator<Item = (&Slot<K>, &K::Content)>
The blocks in render order.
Sourcepub fn has_staged(&self) -> bool
pub fn has_staged(&self) -> bool
Whether any change is waiting for reassembly.
Source§impl SystemRegion<Instruction>
impl SystemRegion<Instruction>
Sourcepub fn insert_tagged(&mut self, slot: &InstructionSlot, content: &str)
pub fn insert_tagged(&mut self, slot: &InstructionSlot, content: &str)
Inserts or replaces the block in slot, wrapped in a tag named after
the slot.
§Panics
Panics if the layout has no such slot.
Trait Implementations§
Source§impl<'de, K: BlockKind> Deserialize<'de> for SystemRegion<K>where
K::Content: DeserializeOwned,
impl<'de, K: BlockKind> Deserialize<'de> for SystemRegion<K>where
K::Content: DeserializeOwned,
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K: BlockKind> Serialize for SystemRegion<K>
impl<K: BlockKind> Serialize for SystemRegion<K>
impl<K: PartialEq + BlockKind> StructuralPartialEq for SystemRegion<K>
Auto Trait Implementations§
impl<K> Forget for SystemRegion<K>
impl<K> Freeze for SystemRegion<K>
impl<K> Move for SystemRegion<K>
impl<K> RefUnwindSafe for SystemRegion<K>where
Vec<Slot<K>>: RefUnwindSafe,
BTreeMap<Slot<K>, <K as BlockKind>::Content>: RefUnwindSafe,
BTreeMap<Slot<K>, Option<<K as BlockKind>::Content>>: RefUnwindSafe,
impl<K> Send for SystemRegion<K>
impl<K> Sync for SystemRegion<K>
impl<K> Unpin for SystemRegion<K>
impl<K> UnsafeUnpin for SystemRegion<K>where
Vec<Slot<K>>: UnsafeUnpin,
BTreeMap<Slot<K>, <K as BlockKind>::Content>: UnsafeUnpin,
BTreeMap<Slot<K>, Option<<K as BlockKind>::Content>>: UnsafeUnpin,
impl<K> UnwindSafe for SystemRegion<K>where
Vec<Slot<K>>: UnwindSafe,
BTreeMap<Slot<K>, <K as BlockKind>::Content>: UnwindSafe,
BTreeMap<Slot<K>, Option<<K as BlockKind>::Content>>: UnwindSafe,
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