pub struct Translator { /* private fields */ }Expand description
Stateful but I/O-free translation in both directions.
Implementations§
Source§impl Translator
impl Translator
pub fn new() -> Self
Sourcepub fn initialize(&mut self, capabilities: ClientCapabilities) -> Message
pub fn initialize(&mut self, capabilities: ClientCapabilities) -> Message
The opening handshake. Sent once, before anything else.
Sourcepub fn outgoing(&mut self, request: AgentRequest) -> Vec<Message>
pub fn outgoing(&mut self, request: AgentRequest) -> Vec<Message>
Turn one of our requests into wire messages.
Anything sent before initialize completes is queued rather than dropped: a user
who starts a session the instant the app opens should not lose it to a race.
Trait Implementations§
Source§impl Debug for Translator
impl Debug for Translator
Source§impl Default for Translator
impl Default for Translator
Source§fn default() -> Translator
fn default() -> Translator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Translator
impl RefUnwindSafe for Translator
impl Send for Translator
impl Sync for Translator
impl Unpin for Translator
impl UnsafeUnpin for Translator
impl UnwindSafe for Translator
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