pub struct MessageSource<'a>(/* private fields */);Expand description
The public seam for “where does this operation’s message come from?”
— the one parameter type op constructors accept. It has exactly two
adapters: plain bytes (borrowed now, copied into librnp-owned memory
at execution) and a caller-built Input (passed through untouched,
so reader-backed streaming works). Construct via Into from either
— &[u8], string literals/arrays (b"..."), or an Input.
let from_bytes: MessageSource = b"plain bytes".into();
let from_input: MessageSource = Input::from_memory(b"streamed").unwrap().into();
let _ = (from_bytes, from_input);Implementations§
Source§impl<'a> MessageSource<'a>
impl<'a> MessageSource<'a>
Sourcepub fn from_bytes(bytes: &'a [u8]) -> Self
pub fn from_bytes(bytes: &'a [u8]) -> Self
Borrowed bytes; copied into librnp-owned memory when the operation executes.
Sourcepub fn from_input(input: Input) -> Self
pub fn from_input(input: Input) -> Self
A caller-built Input — e.g. from Input::from_reader —
passed through untouched so streaming sources work.
Trait Implementations§
Source§impl<'a> Debug for MessageSource<'a>
impl<'a> Debug for MessageSource<'a>
Source§impl<'a> From<&'a [u8]> for MessageSource<'a>
impl<'a> From<&'a [u8]> for MessageSource<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MessageSource<'a>
impl<'a> !Send for MessageSource<'a>
impl<'a> !Sync for MessageSource<'a>
impl<'a> !UnwindSafe for MessageSource<'a>
impl<'a> Freeze for MessageSource<'a>
impl<'a> Unpin for MessageSource<'a>
impl<'a> UnsafeUnpin for MessageSource<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more