Module aws_iam::io

source · []
Expand description

Provides basic file read/write functions for policies.

This module wraps basic read and write operations and the relevant Serde serialization and deserialization logic. Both read and write functions come in two forms, one which takes a file name in the form of a PathBuf and one which either takes an implementation of std::io::Read or std::io::Write.

Example

The following reads a policy document from a JSON file and returns the parsed form.

use aws_iam::{io, model::*};
use std::path::PathBuf;

let policy = io::read_from_file(
        &PathBuf::from("tests/data/good/example-021.json")
    ).expect("Error reading file");

Enums

Errors possible with file read/write.

Functions

Read a Policy document from the file at path.

Read a Policy document from any implementation of std::io::Read.

Read a Policy document from a string.

Write the policy object to a file at path, this will create a file if it does not exist and overwrite any file if it exists.

Write the policy object to any implementation of std::io::Write.