pub struct ParseOpts {
pub importer: Option<String>,
pub for_agent: ForAgent,
pub signer: Option<Agent>,
pub save: SaveOpts,
pub overwrite_outside: bool,
}
Expand description
Options for parsing (JSON-AD) resources. Many of these are related to rights, as parsing often implies overwriting / setting resources.
Fields§
§importer: Option<String>
URL of the parent / Importer. This is where all the imported data will be placed under, hierarchically.
If imported resources do not have an @id
, we create new @id
using the localId
and the parent
.
If the importer resources already have a parent
set, we’ll use that one.
for_agent: ForAgent
Who’s rights will be checked when creating the imported resources.
Is only used when save
is set to SaveOpts::Commit.
If None is passed, all resources will be
signer: Option<Agent>
Who will perform the importing. If set to none, all possible commits will be signed by the default agent.
Note that this Agent needs a private key to sign the commits.
Is only used when save
is set to Commit
.
save: SaveOpts
How you want to save the Resources, if you want to add Commits for every Resource.
overwrite_outside: bool
Overwrites existing resources with the same @id
, even if they are not children of the importer
.
This can be a dangerous value if true, because it can overwrite all resources where the for_agen
has write rights.
Only parse items from sources that you trust!