Skip to content

Commit af1b7df

Browse files
authored
Remove bitwarden-core docs to move to crate. (#733)
1 parent 18d23cc commit af1b7df

File tree

1 file changed

+3
-47
lines changed

1 file changed

+3
-47
lines changed

docs/architecture/sdk/internal/index.md

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -126,60 +126,16 @@ Password Manager, or Secrets Manager, into a single easy-to-use crate for that p
126126

127127
### Core and Utility
128128

129-
The `bitwarden-core` crate contains the underlying functionality of the SDK. This includes a
130-
[`Client` struct](#client-struct).
131-
132-
There are a number of utility crates that provide a very narrow scope of functionality and do not
133-
necessarily correspond to a single domain, or may be shared across multiple domains. Examples
134-
include UUID handling and cryptographic primitives.
129+
The `bitwarden-core` crate contains the core runtime of the SDK. See the
130+
[crate documentation](https://github.com/bitwarden/sdk-internal/tree/main/crates/bitwarden-core) for
131+
more details.
135132

136133
### Features and Domains
137134

138135
Feature and domain crates constitute the application business logic. Feature crates depend on
139136
`bitwarden-core` and provide extensions to the Client struct to implement specific domains.
140137
<Bitwarden>These crates are usually owned and maintained by individual teams.</Bitwarden>
141138

142-
## Client Struct
143-
144-
The `Client` struct is the main entry point for the SDK and represents a single account instance.
145-
Any action that needs to be performed on the account is generally done through the `Client` struct.
146-
This allows the internals to be hidden from the consumer and provides a clear API.
147-
148-
We can extend the `Client` struct using extension traits in feature crates. This allow the
149-
underlying implementation to be internal to the crate with only the public API exposed through the
150-
`Client` struct. Below is an example of a generator extension for the `Client` struct.
151-
152-
```rust
153-
/// Generator extension for the Client struct
154-
#[cfg_attr(feature = "wasm", wasm_bindgen)]
155-
pub struct GeneratorClient {
156-
client: Client,
157-
}
158-
159-
#[cfg_attr(feature = "wasm", wasm_bindgen)]
160-
impl GeneratorClient {
161-
fn new(client: Client) -> Self {
162-
Self { client }
163-
}
164-
165-
/// Generates a password based on the provided request.
166-
pub fn password(&self, input: PasswordGeneratorRequest) -> Result<String, PasswordError> {
167-
password(input)
168-
}
169-
}
170-
171-
/// Extension which exposes `generator` method on the `Client` struct.
172-
pub trait GeneratorClientExt {
173-
fn generator(&self) -> GeneratorClient;
174-
}
175-
176-
impl GeneratorClientExt for Client {
177-
fn generator(&self) -> GeneratorClient {
178-
GeneratorClient::new(self.clone())
179-
}
180-
}
181-
```
182-
183139
## Language bindings
184140

185141
The internal SDK supports mobile and web platforms and uses UniFFI and `wasm-bindgen` to generate

0 commit comments

Comments
 (0)