use std::path::PathBuf;
use std::str::FromStr;
use clap::ValueEnum;
use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
use thiserror::Error;
use crate::surface::error::CommandError;
use crate::surface::output::{
diagnostics_from_entry_report, display_path, display_paths, format_gen_link_report,
format_query_json, query_result_records,
};
use crate::{
CheckMode, EntryAddress, EntryAddressError, EntryAtom, EntryDirectoryReport,
EntryStructuralMatcher, GenLinkDirectoryReport, StructuralEdgeSettings, Tide, TideStatus,
TideWorkitem, UpstreamSettings, WitnessRecord,
};
#[derive(Clone, Copy, Debug, Default, ValueEnum)]
pub enum StructuredOutputFormat {
Json,
#[default]
Human,
}
pub(crate) type QueryOutputFormat = StructuredOutputFormat;
pub(crate) type TideOutputFormat = StructuredOutputFormat;
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize, ValueEnum)]
#[serde(rename_all = "kebab-case")]
pub enum TideStatusMode {
#[default]
Review,
Full,
All,
}
impl TideStatusMode {
pub(crate) fn includes_workitems(self) -> bool {
matches!(self, Self::Full | Self::All)
}
pub(crate) fn includes_resolved(self) -> bool {
matches!(self, Self::All)
}
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct CwdResult {
pub ok: bool,
pub changed: bool,
pub path: String,
pub message: String,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ConfigCommentResult {
pub ok: bool,
pub changed: bool,
pub config_path: String,
pub missing_comments: Vec<String>,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct UpstreamAddRequest {
pub domain: EntryAtom,
pub settings: UpstreamSettings,
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct UpstreamCrystallizeRequest {
pub domains: Vec<EntryAtom>,
pub locked: bool,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct QueryColumns {
pub(crate) columns: Vec<QueryColumn>,
}
impl QueryColumns {
pub fn new(columns: Vec<QueryColumn>) -> Self {
Self { columns }
}
pub fn columns(&self) -> &[QueryColumn] {
&self.columns
}
pub fn labels(&self) -> Vec<String> {
self.columns.iter().map(|column| column.label().to_owned()).collect()
}
pub(crate) fn structural_fields(&self) -> impl Iterator<Item = &str> {
self.columns.iter().filter_map(QueryColumn::structural_field)
}
pub fn default_output() -> Self {
Self { columns: vec![QueryColumn::Id, QueryColumn::Name] }
}
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub enum QueryColumnSelection {
#[default]
Default,
Options,
Selected(QueryColumns),
}
impl FromStr for QueryColumns {
type Err = QueryColumnsParseError;
fn from_str(raw: &str) -> Result<Self, Self::Err> {
if raw.trim().is_empty() {
return Err(QueryColumnsParseError::Empty);
}
let mut columns = Vec::new();
for raw_column in raw.split(',') {
let column = raw_column.trim();
if column.is_empty() {
return Err(QueryColumnsParseError::EmptyColumn);
}
columns.push(column.parse()?);
}
Ok(Self { columns })
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum QueryColumn {
Id,
Name,
Path,
Desc,
Structural {
field: String,
},
}
impl FromStr for QueryColumn {
type Err = QueryColumnsParseError;
fn from_str(raw: &str) -> Result<Self, Self::Err> {
match raw {
| "id" => Ok(Self::Id),
| "name" => Ok(Self::Name),
| "path" => Ok(Self::Path),
| "desc" => Ok(Self::Desc),
| column => Ok(Self::Structural { field: column.to_owned() }),
}
}
}
impl QueryColumn {
pub fn label(&self) -> &str {
match self {
| Self::Id => "id",
| Self::Name => "name",
| Self::Path => "path",
| Self::Desc => "desc",
| Self::Structural { field } => field,
}
}
pub fn structural_field(&self) -> Option<&str> {
match self {
| Self::Structural { field } => Some(field),
| Self::Id | Self::Name | Self::Path | Self::Desc => None,
}
}
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum QueryValue {
Text(String),
Targets(Option<Vec<String>>),
}
impl QueryValue {
pub fn text(value: impl Into<String>) -> Self {
Self::Text(value.into())
}
pub fn targets(targets: Option<&[EntryAddress]>) -> Self {
Self::Targets(
targets.map(|targets| targets.iter().map(ToString::to_string).collect::<Vec<_>>()),
)
}
pub(crate) fn display(&self) -> String {
match self {
| Self::Text(value) => value.clone(),
| Self::Targets(Some(targets)) => targets.join(", "),
| Self::Targets(None) => String::new(),
}
}
}
impl From<String> for QueryValue {
fn from(value: String) -> Self {
Self::Text(value)
}
}
#[derive(Debug, Error)]
pub enum QueryColumnsParseError {
#[error("query columns must include at least one column")]
Empty,
#[error("query columns contain an empty column")]
EmptyColumn,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct StructuralFilter {
pub field: String,
pub targets: Vec<EntryAddress>,
}
impl FromStr for StructuralFilter {
type Err = StructuralFilterParseError;
fn from_str(raw: &str) -> Result<Self, Self::Err> {
let Some((field, targets)) = raw.split_once('=') else {
return Err(StructuralFilterParseError::MissingEquals);
};
let field = field.trim();
if field.is_empty() {
return Err(StructuralFilterParseError::EmptyField);
}
let targets = parse_structural_filter_targets(targets)?;
Ok(Self { field: field.to_owned(), targets })
}
}
fn parse_structural_filter_targets(
raw: &str,
) -> Result<Vec<EntryAddress>, StructuralFilterParseError> {
let mut targets = Vec::new();
for raw_target in raw.split(',') {
let target = raw_target.trim();
if target.is_empty() {
return Err(StructuralFilterParseError::EmptyTarget);
}
targets.push(EntryAddress::new(target)?);
}
Ok(targets)
}
#[derive(Debug, Error)]
pub enum StructuralFilterParseError {
#[error("expected FIELD=ENTRY_ADDRESS[,ENTRY_ADDRESS]")]
MissingEquals,
#[error("structural field name must not be empty")]
EmptyField,
#[error("structural filter contains an empty target")]
EmptyTarget,
#[error(transparent)]
EntryAddress(#[from] EntryAddressError),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct StructuralStateFilter {
pub field: String,
pub state: StructuralFieldState,
}
impl FromStr for StructuralStateFilter {
type Err = StructuralStateFilterParseError;
fn from_str(raw: &str) -> Result<Self, Self::Err> {
let Some((field, state)) = raw.split_once('=') else {
return Err(StructuralStateFilterParseError::MissingEquals);
};
let field = field.trim();
if field.is_empty() {
return Err(StructuralStateFilterParseError::EmptyField);
}
Ok(Self { field: field.to_owned(), state: state.trim().parse()? })
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum StructuralFieldState {
Present,
Empty,
Missing,
}
impl FromStr for StructuralFieldState {
type Err = StructuralStateFilterParseError;
fn from_str(raw: &str) -> Result<Self, Self::Err> {
match raw {
| "present" => Ok(Self::Present),
| "empty" => Ok(Self::Empty),
| "missing" => Ok(Self::Missing),
| state => Err(StructuralStateFilterParseError::UnknownState(state.to_owned())),
}
}
}
impl From<StructuralFieldState> for EntryStructuralMatcher {
fn from(value: StructuralFieldState) -> Self {
match value {
| StructuralFieldState::Present => Self::Present,
| StructuralFieldState::Empty => Self::Empty,
| StructuralFieldState::Missing => Self::Missing,
}
}
}
#[derive(Debug, Error)]
pub enum StructuralStateFilterParseError {
#[error("expected FIELD=present, FIELD=empty, or FIELD=missing")]
MissingEquals,
#[error("structural field name must not be empty")]
EmptyField,
#[error("unknown structural field state `{0}`; expected present, empty, or missing")]
UnknownState(String),
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct QueryRequest {
pub terms: Vec<String>,
pub exact_terms: Vec<String>,
pub has: Vec<StructuralFilter>,
pub is: Vec<StructuralStateFilter>,
pub columns: QueryColumnSelection,
}
#[derive(Debug)]
pub enum QueryRun {
ColumnOptions(QueryColumns),
InvalidLake {
columns: QueryColumns,
report: EntryDirectoryReport,
},
Results(QueryResults),
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct QueryResults {
pub(crate) columns: QueryColumns,
pub(crate) rows: Vec<Vec<QueryValue>>,
}
impl QueryResults {
pub fn new(columns: QueryColumns, rows: Vec<Vec<QueryValue>>) -> Self {
Self { columns, rows }
}
pub fn columns(&self) -> &QueryColumns {
&self.columns
}
pub fn rows(&self) -> &[Vec<QueryValue>] {
&self.rows
}
pub fn records(&self) -> Vec<IndexMap<String, QueryValue>> {
query_result_records(&self.columns, &self.rows)
}
pub fn to_json(&self) -> Result<String, CommandError> {
format_query_json(&self.columns, &self.rows)
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct EntryPathsRequest {
pub id: EntryAddress,
pub selection: PathSelection,
pub absolute: bool,
}
impl EntryPathsRequest {
pub fn new(id: EntryAddress, selection: PathSelection, absolute: bool) -> Self {
Self { id, selection, absolute }
}
}
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct LakeInitRequest {
pub lake: Option<PathBuf>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct LakeInitResult {
pub ok: bool,
pub config_path: String,
pub lake_path: String,
pub entry_count: usize,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct StructuralTarget {
pub field: String,
pub target: EntryAddress,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct EntryNewRequest {
pub id: EntryAddress,
pub name: Option<String>,
pub desc: String,
#[serde(default)]
pub structural: Vec<StructuralTarget>,
pub body: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct EntryFileResult {
pub ok: bool,
pub id: String,
pub path: String,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct LocalProtectionResult {
pub ok: bool,
pub dry_run: bool,
pub lake_path: String,
pub paths: Vec<String>,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct EntryReadResult {
pub ok: bool,
pub id: String,
pub path: String,
pub name: String,
pub desc: String,
pub body: String,
pub source: String,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct EntryRenameResult {
pub ok: bool,
pub old_id: String,
pub new_id: String,
pub updated_paths: Vec<String>,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct QueryResponse {
pub ok: bool,
pub columns: Vec<String>,
pub records: Vec<IndexMap<String, QueryValue>>,
pub diagnostics: Vec<DiagnosticRecord>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct RgRequest {
#[serde(default)]
pub with_generated_footer: bool,
pub args: Vec<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct RgResult {
pub ok: bool,
pub exit_code: u8,
pub stdout: String,
pub stderr: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct WitnessSpanResult {
pub start_line: usize,
pub start_column: usize,
pub end_line: usize,
pub end_column: usize,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct WitnessRecordResult {
pub entry: String,
pub path: String,
pub region: WitnessSpanResult,
#[serde(skip_serializing_if = "Option::is_none")]
pub opening: Option<WitnessSpanResult>,
#[serde(skip_serializing_if = "Option::is_none")]
pub closing: Option<WitnessSpanResult>,
pub body: String,
}
impl WitnessRecordResult {
pub(crate) fn from_record(record: &WitnessRecord, verbose: bool) -> Self {
Self {
entry: record.entry.to_string(),
path: display_path(&record.path),
region: WitnessSpanResult::from(record.region),
opening: verbose.then(|| WitnessSpanResult::from(record.opening)),
closing: verbose.then(|| WitnessSpanResult::from(record.closing)),
body: record.body.clone(),
}
}
}
impl From<crate::witness::WitnessSpan> for WitnessSpanResult {
fn from(value: crate::witness::WitnessSpan) -> Self {
Self {
start_line: value.start_line,
start_column: value.start_column,
end_line: value.end_line,
end_column: value.end_column,
}
}
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct WitnessResult {
pub ok: bool,
pub id: String,
pub records: Vec<WitnessRecordResult>,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ArtifactListResult {
pub ok: bool,
pub id: String,
pub artifacts: Vec<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ArtifactAddRequest {
pub id: EntryAddress,
pub source: PathBuf,
pub artifact_path: Option<PathBuf>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ArtifactRenameRequest {
pub id: EntryAddress,
pub old_path: PathBuf,
pub new_path: PathBuf,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ArtifactRemoveRequest {
pub id: EntryAddress,
pub artifact_path: PathBuf,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ArtifactChangeResult {
pub ok: bool,
pub id: String,
pub artifact_path: String,
pub path: String,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct SkillWrapperRecord {
pub entry_id: String,
pub name: String,
pub wrapper_path: String,
pub full_path: String,
pub target_path: String,
pub status: String,
pub changed: bool,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct SkillWrapperResult {
pub ok: bool,
pub records: Vec<SkillWrapperRecord>,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct MovePathResult {
pub ok: bool,
pub moved: bool,
pub old_path: String,
pub new_path: String,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct DiagnosticRecord {
pub severity: String,
pub path: Option<String>,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct LakeCheckResult {
pub ok: bool,
pub root: String,
pub has_errors: bool,
pub diagnostics: Vec<DiagnosticRecord>,
}
impl LakeCheckResult {
pub(crate) fn from_report(report: &EntryDirectoryReport) -> Self {
let has_errors = report.has_errors();
Self {
ok: !has_errors,
root: display_path(report.root()),
has_errors,
diagnostics: diagnostics_from_entry_report(report),
}
}
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct RenderResult {
pub ok: bool,
pub dry: bool,
pub root: String,
pub entry_count: usize,
pub changed_paths: Vec<String>,
pub diagnostics: Vec<DiagnosticRecord>,
pub message: String,
}
impl RenderResult {
pub(crate) fn from_report(report: &GenLinkDirectoryReport, dry: bool) -> Self {
let changed_paths = display_paths(report.changed_paths());
Self {
ok: true,
dry,
root: display_path(report.root()),
entry_count: report.entry_count(),
changed_paths,
diagnostics: Vec::new(),
message: format_gen_link_report(
report.root(),
report.entry_count(),
report.changed_paths(),
),
}
}
pub(crate) fn blocked(report: &EntryDirectoryReport) -> Self {
Self {
ok: false,
dry: false,
root: display_path(report.root()),
entry_count: report.entries().len(),
changed_paths: Vec::new(),
diagnostics: diagnostics_from_entry_report(report),
message: format!("render blocked by check errors in {}", report.root().display()),
}
}
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct StructuralEdgeStatus {
pub render: bool,
pub ripple_lake: bool,
pub ripple_frost: bool,
}
impl StructuralEdgeStatus {
pub(crate) fn from_settings(settings: &StructuralEdgeSettings) -> Self {
Self {
render: settings.render,
ripple_lake: settings.ripple.lake,
ripple_frost: settings.ripple.frost,
}
}
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct StructuralFieldStatus {
pub field: String,
pub to: StructuralEdgeStatus,
pub from: StructuralEdgeStatus,
pub clique: StructuralEdgeStatus,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum StatusFrostState {
Unlocked,
Current,
CheckedOut,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct StatusFrost {
pub path: String,
pub state: StatusFrostState,
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub generation: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mutable: Option<bool>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct StatusCheckPolicy {
pub mode: CheckMode,
pub render: bool,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct StatusTide {
pub clear: bool,
pub open_workitems: usize,
pub open_waves: usize,
pub review_entries: usize,
}
impl StatusTide {
pub(crate) fn from_tide(tide: &Tide) -> Self {
let open_statuses = tide.open_statuses().collect::<Vec<_>>();
let open_waves = open_statuses
.iter()
.map(|status| &status.workitem.ripple)
.collect::<std::collections::BTreeSet<_>>()
.len();
Self {
clear: open_statuses.is_empty(),
open_workitems: open_statuses.len(),
open_waves,
review_entries: tide.review_entries().len(),
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum StatusCommitState {
Ready,
Blocked,
Unavailable,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum StatusCommitBlocker {
LakeCheck,
Tide,
ImmutableCheckout,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct StatusCommit {
pub ready: bool,
pub state: StatusCommitState,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub blockers: Vec<StatusCommitBlocker>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct StatusResult {
pub ok: bool,
pub config_path: String,
pub lake_path: String,
pub entry_count: usize,
#[serde(skip_serializing_if = "Option::is_none")]
pub frost: Option<StatusFrost>,
pub check_policy: StatusCheckPolicy,
pub structural_fields: Vec<StructuralFieldStatus>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tide: Option<StatusTide>,
pub commit: StatusCommit,
pub check: LakeCheckResult,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct FrostInitResult {
pub ok: bool,
pub frost_path: String,
pub version: u64,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct FrostCommitResult {
pub ok: bool,
pub version: u64,
pub lake_path: String,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct FrostGcResult {
pub ok: bool,
pub frost_path: String,
pub before_generation: u64,
pub before_version: u64,
pub after_generation: u64,
pub after_version: u64,
pub artifact_files_removed: usize,
pub artifact_directories_removed: usize,
pub collected: bool,
pub message: String,
}
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct FrostCheckoutRequest {
pub version: Option<u64>,
#[serde(default)]
pub latest: bool,
#[serde(default)]
pub unsafe_mutable: bool,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct FrostCheckoutResult {
pub ok: bool,
pub version: u64,
pub lake_path: String,
pub entry_count: usize,
pub state: String,
pub message: String,
}
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct TideSelectionRequest {
#[serde(default)]
pub neighbors: Vec<EntryAddress>,
#[serde(default)]
pub workitems: Vec<TideWorkitem>,
}
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct TideResolveRequest {
#[serde(default)]
pub infer: bool,
#[serde(default)]
pub neighbors: Vec<EntryAddress>,
#[serde(default)]
pub workitems: Vec<TideWorkitem>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct TideChangeResult {
pub ok: bool,
pub count: usize,
pub message: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct TideStatusResult {
pub ok: bool,
pub review_entries: Vec<EntryAddress>,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub statuses: Vec<TideStatus>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct PathSelection {
pub(crate) entry: bool,
pub(crate) artifact: bool,
pub(crate) frost: bool,
}
impl PathSelection {
pub fn all() -> Self {
Self { entry: true, artifact: true, frost: true }
}
pub fn new(entry: bool, artifact: bool, frost: bool) -> Self {
Self { entry, artifact, frost }
}
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub struct PathRecord {
pub kind: &'static str,
pub path: String,
}
impl PathRecord {
pub(crate) fn new(kind: &'static str, path: PathBuf) -> Self {
Self { kind, path: path.display().to_string() }
}
}