pub struct BoundedFragment {
pub id: FragmentId,
pub role: FragmentRole,
pub marker: &'static str,
pub max_bytes: usize,
pub content: String,
pub content_hash: u64,
}Fields§
§id: FragmentId§role: FragmentRole§marker: &'static str§max_bytes: usize§content: String§content_hash: u64Implementations§
Source§impl BoundedFragment
impl BoundedFragment
pub fn new(id: FragmentId, raw: impl Into<String>) -> Self
pub fn with_max_bytes( id: FragmentId, raw: impl Into<String>, max_bytes: usize, ) -> Self
pub fn project_instructions(raw: impl Into<String>) -> Self
pub fn constitution(raw: impl Into<String>) -> Self
pub fn render_marked(&self) -> String
Trait Implementations§
Source§impl Clone for BoundedFragment
impl Clone for BoundedFragment
Source§fn clone(&self) -> BoundedFragment
fn clone(&self) -> BoundedFragment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ContextFragment for BoundedFragment
impl ContextFragment for BoundedFragment
fn fragment_id(&self) -> FragmentId
fn marker(&self) -> &'static str
fn content(&self) -> &str
fn max_bytes(&self) -> usize
fn matches_text(&self, haystack: &str) -> bool
fn tokens_est(&self) -> usize
fn is_within_token_ceiling(&self) -> bool
fn is_within_byte_ceiling(&self) -> bool
Source§impl Debug for BoundedFragment
impl Debug for BoundedFragment
impl Eq for BoundedFragment
Source§impl PartialEq for BoundedFragment
impl PartialEq for BoundedFragment
impl StructuralPartialEq for BoundedFragment
Auto Trait Implementations§
impl Freeze for BoundedFragment
impl RefUnwindSafe for BoundedFragment
impl Send for BoundedFragment
impl Sync for BoundedFragment
impl Unpin for BoundedFragment
impl UnsafeUnpin for BoundedFragment
impl UnwindSafe for BoundedFragment
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.