# Struct `kurogane::Origin`

```rust
pub struct Origin(/* private field */);
```

Security origin of a frame as `scheme://host[:port]` or opaque.

Serialized like `location.origin` with a lowercase scheme and host and
default ports elided. Frames without a host (`file:`, `data:`, `about:`)
and unparseable URLs are opaque. An opaque origin matches no rule and no
grant.

## Associated constants

### `OPAQUE`

```rust
const OPAQUE: Origin = _
```

The opaque origin.

## Methods

### `from_url`

```rust
pub fn from_url(url: &str) -> Origin
```

The origin of the document at `url` (browser side; never fails).

### `parse`

```rust
pub fn parse(text: &str) -> Result<Origin, OriginError>
```

Parses a configured origin such as `app://app` or
`http://localhost:5173`.

#### Errors

Returns [`OriginError`] when `text` is not a URL, has no host, is a
`file:` URL, or carries a path, query, fragment or credentials.

[`OriginError`]: https://kurogane-rs.org/docs/api/ipc/originerror.md

### `is_opaque`

```rust
pub fn is_opaque(&self) -> bool
```

Returns true for the opaque origin.

## Trait implementations

- `impl Clone for Origin`
- `impl Debug for Origin`
- `impl Display for Origin`
- `impl Eq for Origin`
- `impl FromStr for Origin`
- `impl Hash for Origin`
- `impl PartialEq for Origin`

Source: https://github.com/0x48piraj/kurogane/blob/584c586118ee53cc04604007ee038557bd859092/kurogane/src/acl.rs#L36
