[][src]Struct google_remotebuildexecution2::BuildBazelRemoteExecutionV2Directory

pub struct BuildBazelRemoteExecutionV2Directory {
    pub files: Option<Vec<BuildBazelRemoteExecutionV2FileNode>>,
    pub symlinks: Option<Vec<BuildBazelRemoteExecutionV2SymlinkNode>>,
    pub directories: Option<Vec<BuildBazelRemoteExecutionV2DirectoryNode>>,
}

A Directory represents a directory node in a file tree, containing zero or more children FileNodes, DirectoryNodes and SymlinkNodes. Each Node contains its name in the directory, either the digest of its content (either a file blob or a Directory proto) or a symlink target, as well as possibly some metadata about the file or directory.

In order to ensure that two equivalent directory trees hash to the same value, the following restrictions MUST be obeyed when constructing a a Directory:

  • Every child in the directory must have a path of exactly one segment. Multiple levels of directory hierarchy may not be collapsed.
  • Each child in the directory must have a unique path segment (file name). Note that while the API itself is case-sensitive, the environment where the Action is executed may or may not be case-sensitive. That is, it is legal to call the API with a Directory that has both "Foo" and "foo" as children, but the Action may be rejected by the remote system upon execution.
  • The files, directories and symlinks in the directory must each be sorted in lexicographical order by path. The path strings must be sorted by code point, equivalently, by UTF-8 bytes.

A Directory that obeys the restrictions is said to be in canonical form.

As an example, the following could be used for a file named bar and a directory named foo with an executable file named baz (hashes shortened for readability):

// (Directory proto)
{
  files: [
    {
      name: "bar",
      digest: {
        hash: "4a73bc9d03...",
        size: 65534
      }
    }
  ],
  directories: [
    {
      name: "foo",
      digest: {
        hash: "4cf2eda940...",
        size: 43
      }
    }
  ]
}
 
// (Directory proto with hash "4cf2eda940..." and size 43)
{
  files: [
    {
      name: "baz",
      digest: {
        hash: "b2c941073e...",
        size: 1294,
      },
      is_executable: true
    }
  ]
}

This type is not used in any activity, and only used as part of another schema.

Fields

files: Option<Vec<BuildBazelRemoteExecutionV2FileNode>>

The files in the directory.

symlinks: Option<Vec<BuildBazelRemoteExecutionV2SymlinkNode>>

The symlinks in the directory.

directories: Option<Vec<BuildBazelRemoteExecutionV2DirectoryNode>>

The subdirectories in the directory.

Trait Implementations

impl Part for BuildBazelRemoteExecutionV2Directory[src]

impl Default for BuildBazelRemoteExecutionV2Directory[src]

impl Clone for BuildBazelRemoteExecutionV2Directory[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for BuildBazelRemoteExecutionV2Directory[src]

impl Serialize for BuildBazelRemoteExecutionV2Directory[src]

impl<'de> Deserialize<'de> for BuildBazelRemoteExecutionV2Directory[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]