pub struct ConstitutionResponse {
pub version: String,
pub text: String,
pub total_lines: u64,
pub lines: Option<LineRange>,
}Expand description
Response from GET /api/constitution and the MCP get_constitution tool.
Fields§
§version: StringVersion string parsed from the document header, e.g. "0.3". A
prompt has no header: its version is sha256: and the first 16 hex
digits of its text’s hash, which changes exactly when the text does.
text: StringThe constitution’s text as markdown: whole, or with lines only
those lines
total_lines: u64The whole text’s lines, which lines counts in (0.118.0; 0 from
an older server)
lines: Option<LineRange>The lines text holds, for a read of some lines (lines=): the
range asked for, its end clamped to the last line (0.118.0)
Implementations§
Source§impl ConstitutionResponse
impl ConstitutionResponse
Sourcepub fn new(
version: String,
text: &str,
lines: Option<LineRange>,
) -> Result<Self, DocumentPastEnd>
pub fn new( version: String, text: &str, lines: Option<LineRange>, ) -> Result<Self, DocumentPastEnd>
Version version’s text, whole or with lines those lines of it
(DocumentLines::select)
Trait Implementations§
Source§impl Debug for ConstitutionResponse
impl Debug for ConstitutionResponse
Source§impl<'de> Deserialize<'de> for ConstitutionResponse
impl<'de> Deserialize<'de> for ConstitutionResponse
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
Auto Trait Implementations§
impl Freeze for ConstitutionResponse
impl RefUnwindSafe for ConstitutionResponse
impl Send for ConstitutionResponse
impl Sync for ConstitutionResponse
impl Unpin for ConstitutionResponse
impl UnsafeUnpin for ConstitutionResponse
impl UnwindSafe for ConstitutionResponse
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