Borrown - Borrowed or owned, simplified for no-std.

crates.io Documentation License

Borrow or owned, inspired by Cow.

Provide common trait implementations over T.

Example

```rust use borrown::Borrown;

[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]

struct Foo { pub _val: usize, }

let x = Foo { _val: 0 }; let b = Borrown::Borrowed(&x);

let : &Foo = b.asref(); let : &mut Foo = b.clone().asmut(); let : Borrown<', Foo> = Default::default(); let : usize = *b; let _: bool = b == Borrown::Borrowed(&x); let _: bool = b <= Borrown::Borrowed(&x); let _: Borrown<', Foo> = b.clone(); let : Foo = b.intoowned();

println!("{:?}", Borrown::Borrowed(&x));

impl core::ops::Deref for Foo { type Target = usize;

fn deref(&self) -> &usize {
    &self._val
}

} ```