Trait SpannerResource

Source
pub trait SpannerResource {
    // Required methods
    fn name(&self) -> &str;
    fn resources_path(&self) -> String;

    // Provided method
    fn id(&self) -> String { ... }
}
Expand description

A trait for identifiable resources within Cloud Spanner.

The format is typically something like <kind>/<name> where kind is the plural form of the resource kind, e.g.: projects or databases and name is the name of a particular instance of that resource.

For example, the database resource named my-database in the my-instance instance in the my-gcp-project project will have the following identifier: projects/my-gcp-project/instances/my-instance/databases/my-database.

Required Methods§

Source

fn name(&self) -> &str

The name of this particular instance of the resource.

Source

fn resources_path(&self) -> String

The full path to all resources under the same parent.

For example, for the InstanceId resource, this would return something like projects/my-project/instances

Provided Methods§

Source

fn id(&self) -> String

The full path to this particular resource.

For example, projects/my-project/instances/my-instance

Implementors§