Expand description
§cirrus-metadata
A Rust client for the Salesforce Metadata API (SOAP). Built on top of
cirrus_auth for credentials, so any AuthSession configured for the
REST client (cirrus) works here too.
Covered surface: the file-based deploy/retrieve flow, synchronous CRUD
(createMetadata / readMetadata / updateMetadata /
upsertMetadata / deleteMetadata / renameMetadata), the utility
surface (listMetadata / describeMetadata / describeValueType),
and a typed PackageManifest builder.
§Why SOAP?
The Metadata API’s REST surface only covers four deployRequest
endpoints. Everything else — retrieve, listMetadata,
describeMetadata, createMetadata, readMetadata, etc. — is
SOAP-only. SOAP is not deprecated; it’s the canonical surface.
§Design principles
- No user-facing types. The 200+ concrete metadata types
(
CustomObject,ApexClass, …) are caller-supplied XML orserde_json::Value. Only platform-contract envelopes are typed. - No legacy surface. Operations Salesforce labels deprecated
(
create(),update(),delete()pre-API-31) are not exposed. - Auth is pluggable. Any
cirrus_auth::AuthSessionworks. - Same credentials as
cirrus. Both crates wrap the sameAuthSessiontrait; oneSharedAuthdrives both clients.
§Quick start
use cirrus_metadata::{MetadataClient, auth::StaticTokenAuth};
use std::sync::Arc;
let auth = Arc::new(StaticTokenAuth::new(
"00D...!AQ...",
"https://my-org.my.salesforce.com",
));
let md = MetadataClient::builder()
.auth(auth)
.build()?;
Re-exports§
pub use handlers::file_based::WaitConfig;pub use result::AsyncRequestState;pub use result::AsyncResult;pub use result::CancelDeployResult;pub use result::CodeCoverageResult;pub use result::CodeCoverageWarning;pub use result::DeleteResult;pub use result::DeployDetails;pub use result::DeployMessage;pub use result::DeployOptions;pub use result::DeployProblemType;pub use result::DeployResult;pub use result::DeployStatus;pub use result::DescribeMetadataObject;pub use result::DescribeMetadataResult;pub use result::DescribeValueTypeResult;pub use result::FileProperties;pub use result::ListMetadataQuery;pub use result::ManageableState;pub use result::MetadataApiError;pub use result::PicklistEntry;pub use result::RetrieveMessage;pub use result::RetrieveRequest;pub use result::RetrieveResult;pub use result::RetrieveStatus;pub use result::RunTestFailure;pub use result::RunTestSuccess;pub use result::RunTestsResult;pub use result::SaveResult;pub use result::TestLevel;pub use result::UpsertResult;pub use result::ValueTypeField;pub use retry::RetryPolicy;pub use cirrus_auth as auth;
Modules§
- handlers
- Typed handlers for Metadata API operations.
- result
- Typed wire envelopes for the file-based Metadata API operations.
- retry
- Retry policy and backoff machinery for transient HTTP failures.
Structs§
- Metadata
Client - The Metadata API client.
- Metadata
Client Builder - Builder for
MetadataClient. - Metadata
Type - Identifier for a metadata type — the
xml_namevalue that goes in<types><name>and as the SOAP type parameter. - Package
Manifest - Builder for
package.xmland the SOAPunpackagedretrieve parameter. - Soap
Fault - A parsed SOAP 1.1
<Fault>element.
Enums§
- Auth
Error - Errors produced while acquiring or refreshing a Salesforce OAuth session.
- Metadata
Error - Errors produced by the
cirrus-metadataclient.
Constants§
- DEFAULT_
API_ VERSION - Default Metadata API version when the caller doesn’t override it.
Traits§
- Auth
Session - Abstraction over a Salesforce authentication session.
- Soap
Operation - A typed SOAP operation against the Metadata API.
Type Aliases§
- Metadata
Result - Specialized
Resulttype forcirrus-metadataoperations. - Shared
Auth Arc<dyn AuthSession>— the shape stored inside the client.