# Rust · rustdoc

Real stable rustdoc HTML output from the checked-in rust fixture source. Generated artifacts, commands, versions, and SHA-256 hashes are recorded under sources/native. This is a teaching library, not a published SDK.

> Source: https://appgram.github.io/docsy/versions/current/fr/rust-sdk  
> Language: rust  
> Symbols: 19 across 3 categories

## Categories

- [Enums](#enums) — 1 items
- [Methods](#methods) — 17 items
- [Structs](#structs) — 1 items

## Enums

### `GreetingError`  <sub>enum</sub>

Validation failures returned by the greeting API.

**Values** — `EmptyName`

```rust
pub enum GreetingError { EmptyName, }
```

## Methods

### `borrow`  <sub>method</sub>

Source § fn borrow (&self) -> &T Immutably borrows from an owned value. Read more

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `self` | `unknown` | ✓ |  |

**Returns** — `&T`

```rust
fn borrow(&self) -> &T
```

---

### `borrow`  <sub>method</sub>

Source § fn borrow (&self) -> &T Immutably borrows from an owned value. Read more

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `self` | `unknown` | ✓ |  |

**Returns** — `&T`

```rust
fn borrow(&self) -> &T
```

---

### `borrow_mut`  <sub>method</sub>

Source § fn borrow_mut (&mut self) -> &mut T Mutably borrows from an owned value. Read more

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `self` | `&mut` | ✓ |  |

**Returns** — `&mut T`

```rust
fn borrow_mut(&mut self) -> &mut T
```

---

### `borrow_mut`  <sub>method</sub>

Source § fn borrow_mut (&mut self) -> &mut T Mutably borrows from an owned value. Read more

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `self` | `&mut` | ✓ |  |

**Returns** — `&mut T`

```rust
fn borrow_mut(&mut self) -> &mut T
```

---

### `from`  <sub>method</sub>

Returns the argument unchanged.

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `t` | `T` | ✓ |  |

**Returns** — `T`

```rust
fn from(t: T) -> T
```

---

### `from`  <sub>method</sub>

Returns the argument unchanged.

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `t` | `T` | ✓ |  |

**Returns** — `T`

```rust
fn from(t: T) -> T
```

---

### `greet`  <sub>method</sub>

Greet a reader.

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `name` | `&str` | ✓ |  |

**Returns** — `String`

```rust
pub fn greet(name: &str) -> String
```

**Example**

```rust
let greeting = greeter::Greeter::greet("Docsy");
```

---

### `greet_checked`  <sub>method</sub>

Reject an empty reader name.

**Errors**

- `Result::Err` — Returns GreetingError::EmptyName when name is empty.

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `name` | `&str` | ✓ |  |

**Returns** — `Result<String, GreetingError>`

```rust
pub fn greet_checked(name: &str) -> Result<String, GreetingError>
```

**Example**

```rust
assert!(greeter::Greeter::greet_checked("").is_err());
```

---

### `greet_many`  <sub>method</sub>

Greet several readers while preserving input order.

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `names` | `&[&str]` | ✓ |  |

**Returns** — `Vec<String>`

```rust
pub fn greet_many(names: &[&str]) -> Vec<String>
```

**Example**

```rust
let greetings = greeter::Greeter::greet_many(&["Ada", "Linus"]);
assert_eq!(greetings.len(), 2);
```

---

### `into`  <sub>method</sub>

Calls U::from(self) .

**Returns** — `U`

```rust
fn into(self) -> U
```

---

### `into`  <sub>method</sub>

Calls U::from(self) .

**Returns** — `U`

```rust
fn into(self) -> U
```

---

### `try_from`  <sub>method</sub>

Source § fn try_from (value: U) -> Result <T, <T as TryFrom <U>>:: Error > Performs the conversion.

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `value` | `U` | ✓ |  |

**Returns** — `Result<T, <T as TryFrom<U>>::Error>`

```rust
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
```

---

### `try_from`  <sub>method</sub>

Source § fn try_from (value: U) -> Result <T, <T as TryFrom <U>>:: Error > Performs the conversion.

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `value` | `U` | ✓ |  |

**Returns** — `Result<T, <T as TryFrom<U>>::Error>`

```rust
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
```

---

### `try_into`  <sub>method</sub>

Source § fn try_into (self) -> Result <U, <U as TryFrom <T>>:: Error > Performs the conversion.

**Returns** — `Result<U, <U as TryFrom<T>>::Error>`

```rust
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
```

---

### `try_into`  <sub>method</sub>

Source § fn try_into (self) -> Result <U, <U as TryFrom <T>>:: Error > Performs the conversion.

**Returns** — `Result<U, <U as TryFrom<T>>::Error>`

```rust
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
```

---

### `type_id`  <sub>method</sub>

Source § fn type_id (&self) -> TypeId Gets the TypeId of self . Read more

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `self` | `unknown` | ✓ |  |

**Returns** — `TypeId`

```rust
fn type_id(&self) -> TypeId
```

---

### `type_id`  <sub>method</sub>

Source § fn type_id (&self) -> TypeId Gets the TypeId of self . Read more

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `self` | `unknown` | ✓ |  |

**Returns** — `TypeId`

```rust
fn type_id(&self) -> TypeId
```

## Structs

### `Greeter`  <sub>struct</sub>

Build personalized greetings without network access.

**Properties**

| Name | Type | Required | Description | Default |

| --- | --- | --- | --- | --- |

| `prefix` | `String` | ✓ |  |  |

```rust
pub struct Greeter { pub prefix: String, }
```

**Example**

```rust
let greeting = greeter::Greeter::greet("Docsy");
assert_eq!(greeting, "Hello, Docsy");
```
