Records

  • file format 6
  • Rust SDK 1.0 preview

One record: parsing it from a JSON line, its kind and version, its identity, and typed views of entities and relations.

On this page, Result<T> is std::result::Result<T, plxi_sdk::Error>.

Every public struct and enum with a public field or variant is marked #[non_exhaustive]: code outside the crate builds one through its constructors and matches an enum with a _ arm.

Structs

method

Record::from_json_line

Spec §4.2
pub fn from_json_line(line: &str) -> Result<Record>
Summary

Parse one JSON line (spec §4).

The line is parsed and written out again, so json_line is the SDK's spelling of it (spec §4.3-§4.4), which can differ from the input bytes in the member order of typed records, in escapes and in number spelling.

Parameters
  • line: &str
Returns
Result<Record>
Errors

json for invalid JSON or a typed record that fails its schema; invalid_record for a value that is not an object or has no string k.

method

Record::to_json_value

Spec §4
pub fn to_json_value(&self) -> Result<Value>
Summary

The parsed JSON value of the line.

Parameters
None.
Returns
Result<Value>
Errors

None in practice; json if it ever fails to parse.

struct

EntityView

Spec §5.1
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct EntityView<'a> {
    pub id: &'a str,
    pub t: &'a str,
    pub name: Option<&'a str>,
    pub salience: Option<f32>,
    pub stub: bool,
}
Summary

Borrowed view of an ent record (spec §5.1 rank 3).

Fields
  • id: &'a strid.
  • t: &'a strt, the entity type.
  • name: Option<&'a str>name, when present.
  • salience: Option<f32>salience, when present.
  • stub: boolstub.
struct

RelationView

Spec §5.1
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct RelationView<'a> {
    pub src: &'a str,
    pub tgt: &'a str,
    pub kind: &'a str,
}
Summary

Borrowed view of a rel record (spec §5.1 rank 4).

Fields
  • src: &'a strsrc.
  • tgt: &'a strtgt.
  • kind: &'a strkind, the relation label.

© 2020-2026 Cintile Inc. All Rights Reserved.

Anyone may implement this format. Copying or republishing the text of this specification requires permission from Cintile Inc.

Sections