# query.private.one_relation

- **Module:** query.private
- **Package:** libtmux
- **Language:** Rust
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/query/private.rs#L860
- **Page:** https://libtmux.org/en/rs/latest/reference/query-private-one_relation/

```
query.private.one_relation(target: &'static str, field: &'static str) -> OneRelation<From, To>
```

Construct a to-one relation handle for generated code.

## Example

```rust
use libtmux::query::OneRelation;
use libtmux::query::__private;
struct Parent;
struct Owner;
let field: OneRelation<Parent, Owner> = __private::one_relation("parent", "owner");
assert!(format!("{field:?}").contains("owner"));
```
