pub struct Artifact {Show 13 fields
pub location: Option<ArtifactLocation>,
pub parent_index: Option<i32>,
pub offset: Option<i32>,
pub length: Option<i32>,
pub roles: Option<Vec<ArtifactRole>>,
pub mime_type: Option<String>,
pub contents: Option<ArtifactContent>,
pub encoding: Option<String>,
pub source_language: Option<String>,
pub hashes: Option<Vec<Hash>>,
pub last_modified_time_utc: Option<String>,
pub description: Option<Message>,
pub properties: Option<HashMap<String, Value>>,
}Expand description
A single file
Fields§
§location: Option<ArtifactLocation>The location of the artifact
parent_index: Option<i32>Identifies the index of the immediate parent of the artifact
offset: Option<i32>The offset in bytes of the artifact within its containing artifact
length: Option<i32>The length of the artifact in bytes
roles: Option<Vec<ArtifactRole>>The role or roles played by the artifact in the analysis
mime_type: Option<String>The MIME type of the artifact
contents: Option<ArtifactContent>The contents of the artifact
encoding: Option<String>Specifies the encoding for an artifact object that refers to a text file
source_language: Option<String>Specifies the source language for any artifact that contains source code
hashes: Option<Vec<Hash>>An array of hash objects
last_modified_time_utc: Option<String>The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified
description: Option<Message>A short description of the artifact
properties: Option<HashMap<String, Value>>Key/value pairs that provide additional information about the artifact
Implementations§
Source§impl Artifact
impl Artifact
Sourcepub fn new(location: ArtifactLocation) -> Self
pub fn new(location: ArtifactLocation) -> Self
Create a new artifact with a location
Sourcepub fn add_role(self, role: ArtifactRole) -> Self
pub fn add_role(self, role: ArtifactRole) -> Self
Add a role to the artifact
Sourcepub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
pub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
Set the MIME type
Sourcepub fn with_text_content(self, text: impl Into<String>) -> Self
pub fn with_text_content(self, text: impl Into<String>) -> Self
Set text content