### OwoColorize Implementations for Generic Types (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Demonstrates various `OwoColorize` implementations for generic types `D`, providing methods to set foreground and background colors, including specific color options like black and red. ```rust fn fg(&self) -> FgColorDisplay<'_, C, Self> where C: Color, ``` ```rust fn bg(&self) -> BgColorDisplay<'_, C, Self> where C: Color, ``` ```rust fn black(&self) -> FgColorDisplay<'_, Black, Self> ``` ```rust fn on_black(&self) -> BgColorDisplay<'_, Black, Self> ``` ```rust fn red(&self) -> FgColorDisplay<'_, Red, Self> ``` -------------------------------- ### CloneToUninit Implementation (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Shows the experimental `clone_to_uninit` implementation for types that implement `Clone`, allowing for copying data to uninitialized memory. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` -------------------------------- ### From and Into Implementations for Generic Types (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Illustrates the `From` for `T` and `Into` for `T` implementations, enabling type conversions. ```rust fn from(t: T) -> T ``` ```rust fn into(self) -> U where U: From, ``` -------------------------------- ### Default Implementation for ProtocolInfo (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Provides a default implementation for `ProtocolInfo`, allowing for the creation of a default instance of the struct. ```rust fn default() -> ProtocolInfo ``` -------------------------------- ### Apply Runtime Style (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Applies a style to the text, where the style itself is determined at runtime. This offers flexibility in text formatting based on dynamic conditions. Returns a `Styled` reference. ```rust fn style(&self, style: Style) -> Styled<&Self> ``` -------------------------------- ### Clone Implementation for ProtocolInfo (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Provides implementations for `Clone` and `clone_from` for the `ProtocolInfo` struct, allowing for duplication and efficient copying of its values. ```rust fn clone(&self) -> ProtocolInfo ``` ```rust fn clone_from(&mut self, source: &Self) ``` -------------------------------- ### Serialize Implementation for ProtocolInfo (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Implements the `Serialize` trait from the Serde library for `ProtocolInfo`, allowing for serialization into various data formats. ```rust fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where __S: Serializer, ``` -------------------------------- ### Auto Trait Implementations for ProtocolInfo (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Lists the auto-trait implementations for `ProtocolInfo`, including `Freeze`, `RefUnwindSafe`, `Send`, `Sync`, `Unpin`, and `UnwindSafe`, indicating thread safety and memory management characteristics. ```rust impl Freeze for ProtocolInfo ``` ```rust impl RefUnwindSafe for ProtocolInfo ``` ```rust impl Send for ProtocolInfo ``` ```rust impl Sync for ProtocolInfo ``` ```rust impl Unpin for ProtocolInfo ``` ```rust impl UnwindSafe for ProtocolInfo ``` -------------------------------- ### Check Protocol Compatibility (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Implements a method to check if two `ProtocolInfo` instances are compatible based on their versions. Compatibility is determined by semantic versioning rules. ```rust pub fn is_compatible_with(&self, other: &ProtocolInfo) -> Result ``` -------------------------------- ### Borrow and BorrowMut Implementations for Generic Types (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Demonstrates the `Borrow` and `BorrowMut` trait implementations for generic types `T`, facilitating immutable and mutable borrowing. ```rust fn borrow(&self) -> &T ``` ```rust fn borrow_mut(&mut self) -> &mut T ``` -------------------------------- ### Debug Implementation for ProtocolInfo (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Implements the `Debug` trait for `ProtocolInfo`, enabling formatted output for debugging purposes. ```rust fn fmt(&self, f: &mut Formatter<'_>) -> Result ``` -------------------------------- ### Deserialize Implementation for ProtocolInfo (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Implements the `Deserialize` trait from the Serde library for `ProtocolInfo`, enabling deserialization from various data formats. ```rust fn deserialize<__D>(__deserializer: __D) -> Result where __D: Deserializer<'de>, ``` -------------------------------- ### Any Implementation for Generic Types (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Shows the implementation of the `Any` trait for generic types `T`, which enables runtime type identification. ```rust fn type_id(&self) -> TypeId ``` -------------------------------- ### Set Truecolor Background (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Sets the background color using an RGB tuple (r, g, b). This function enables runtime configuration of background colors with high precision. It returns a `BgDynColorDisplay`. ```rust fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self> ``` -------------------------------- ### ProtocolInfo Struct Definition (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Defines the `ProtocolInfo` struct, which holds information about the protocol, its version, and supported features. This struct is crucial for establishing compatibility between the plugin and the engine. ```rust pub struct ProtocolInfo { pub protocol: Protocol, pub version: String, pub features: Vec, } ``` -------------------------------- ### StreamMessage TryFrom PluginInput/PluginOutput Implementations (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Demonstrates the conversion of `PluginInput` and `PluginOutput` types into `StreamMessage` using `try_from`, handling potential conversion errors. ```rust impl TryFrom for StreamMessage type Error = PluginInput; fn try_from(msg: PluginInput) -> Result impl TryFrom for StreamMessage type Error = PluginOutput; fn try_from(msg: PluginOutput) -> Result ``` -------------------------------- ### Check Supported Feature (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Implements a method to determine if a given `Feature` is supported by the current `ProtocolInfo`. This is useful for checking optional feature support. ```rust pub fn supports_feature(&self, feature: &Feature) -> bool ``` -------------------------------- ### Text Styling (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Applies various text styles to enhance readability or convey emphasis. These functions modify the text's appearance by adding attributes like bold, italic, underline, blinking, reversed colors, hidden text, and strikethrough. ```rust fn bold(&self) -> BoldDisplay<'_, Self> fn dimmed(&self) -> DimDisplay<'_, Self> fn italic(&self) -> ItalicDisplay<'_, Self> fn underline(&self) -> UnderlineDisplay<'_, Self> fn blink(&self) -> BlinkDisplay<'_, Self> fn blink_fast(&self) -> BlinkFastDisplay<'_, Self> fn reversed(&self) -> ReversedDisplay<'_, Self> fn hidden(&self) -> HiddenDisplay<'_, Self> fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self> ``` -------------------------------- ### Set Runtime Background Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Sets the background color of text at runtime. This is useful when the background color is determined dynamically. For compile-time known colors, use `bg` or color-specific methods like `on_yellow`. Requires `Color` trait bound by `DynColor`. ```rust fn on_color(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self> where Color: DynColor ``` -------------------------------- ### Set Truecolor Foreground (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Sets the foreground color using an RGB tuple (r, g, b). This function allows for precise color setting at runtime. It returns a `FgDynColorDisplay`. ```rust fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self> ``` -------------------------------- ### Apply Runtime Style (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Applies a style to text, where the style itself is determined at runtime. This offers flexibility in text formatting. ```rust fn style(&self, style: Style) -> Styled<&Self> ``` -------------------------------- ### Set Runtime Foreground Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Sets the foreground color of text at runtime. Use this when the color is not known at compile time. For static colors, prefer `fg` or specific color methods. Requires the `Color` trait bound by `DynColor`. ```rust fn color(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self> where Color: DynColor ``` -------------------------------- ### Set Foreground RGB Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Sets the foreground color using a specific RGB value. This function utilizes const generics for R, G, and B values, allowing for compile-time color definition. Returns a `FgColorDisplay` struct. ```rust fn fg_rgb( &self, ) -> FgColorDisplay<'_, CustomColor, Self> ``` -------------------------------- ### Clone Into Existing Data (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Clones data from a borrowed source into an existing mutable target. This is an efficient way to update owned data without reallocation. It operates on types that implement the `Clone` trait. ```rust fn clone_into(&self, target: &mut T) ``` -------------------------------- ### Set Background RGB Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Sets the background color using a specific RGB value. This function supports compile-time RGB color specification through const generics. It returns a `BgColorDisplay` struct. ```rust fn bg_rgb( &self, ) -> BgColorDisplay<'_, CustomColor, Self> ``` -------------------------------- ### Set Background Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Sets the background color of the text. Similar to foreground color functions, these methods accept color enum variants and return display structs. They are crucial for creating visually distinct text elements. ```rust fn on_red(&self) -> BgColorDisplay<'_, Red, Self> fn on_green(&self) -> BgColorDisplay<'_, Green, Self> fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self> fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self> fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self> fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self> fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self> fn on_white(&self) -> BgColorDisplay<'_, White, Self> fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self> fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self> fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self> fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self> fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self> fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self> fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self> fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self> fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self> fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self> ``` -------------------------------- ### Set Runtime Background Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Sets the background color of text at runtime. Use this when the background color is determined dynamically. For static colors, utilize `OwoColorize::bg` or color-specific methods like `OwoColorize::on_yellow`. ```rust fn on_color(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self> where Color: DynColor, ``` -------------------------------- ### Do Erased Serialization (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Internal function for performing erased serialization. It takes a mutable reference to a dynamic serializer and returns a `Result` which could contain an `ErrorImpl`. ```rust fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl> ``` -------------------------------- ### IntoSpanned Implementation for Generic Types (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Shows the `IntoSpanned` trait implementation for generic types `T`, enabling wrapping items with a `Span` into `Spanned`. ```rust fn into_spanned(self, span: Span) -> Spanned ``` -------------------------------- ### Try Convert Self (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Attempts to convert the current type `T` into type `U`. This operation relies on `U` implementing `TryFrom`. If the conversion fails, the associated `Error` type from `U` is returned. ```rust type Error = >::Error; fn try_into(self) -> Result>::Error> ``` -------------------------------- ### StreamMessage From PluginInput/PluginOutput Implementations (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Shows how `StreamMessage` can be converted into `PluginInput` and `PluginOutput` types, facilitating integration within the plugin system. ```rust impl From for PluginInput fn from(stream_msg: StreamMessage) -> PluginInput impl From for PluginOutput fn from(stream_msg: StreamMessage) -> PluginOutput ``` -------------------------------- ### Try Into Conversion (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Implements `TryInto` for attempting conversions into another type that implements `TryFrom`. It defines the `Error` type and the `try_into` method for performing the conversion. ```rust type Error = >::Error; fn try_into(self) -> Result>::Error>; ``` -------------------------------- ### Create Owned Data (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Creates an owned version of data from a borrowed reference, typically by cloning. This is essential for scenarios where mutable access or independent data is required. The `Owned` type alias specifies the resulting owned type. ```rust type Owned = T; fn to_owned(&self) -> T ``` -------------------------------- ### Apply Text Styles (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Functions to apply various text styles such as bold, italic, underline, blink, and hidden. ```rust fn bold(&self) -> BoldDisplay<'_, Self> fn dimmed(&self) -> DimDisplay<'_, Self> fn italic(&self) -> ItalicDisplay<'_, Self> fn underline(&self) -> UnderlineDisplay<'_, Self> fn blink(&self) -> BlinkDisplay<'_, Self> fn blink_fast(&self) -> BlinkFastDisplay<'_, Self> fn reversed(&self) -> ReversedDisplay<'_, Self> fn hidden(&self) -> HiddenDisplay<'_, Self> fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self> ``` -------------------------------- ### Try Convert Value (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Attempts to convert a value of type `U` into type `T`. This conversion may fail, in which case an `Infallible` error type is returned. The `U` type must implement `Into`. ```rust type Error = Infallible; fn try_from(value: U) -> Result>::Error> ``` -------------------------------- ### Try Conversion (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Implements `TryFrom` for conversions between types where the conversion might fail. It defines the associated `Error` type and the `try_from` method for attempting the conversion. ```rust type Error = Infallible; fn try_from(value: U) -> Result>::Error>; ``` -------------------------------- ### Set Background Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Functions to set the background color of the text to various predefined colors. ```rust fn on_black(&self) -> BgColorDisplay<'_, Black, Self> fn on_red(&self) -> BgColorDisplay<'_, Red, Self> fn on_green(&self) -> BgColorDisplay<'_, Green, Self> fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self> fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self> fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self> fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self> fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self> fn on_white(&self) -> BgColorDisplay<'_, White, Self> fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self> fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self> fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self> fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self> fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self> fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self> fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self> fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self> fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self> fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self> ``` -------------------------------- ### Erased Serialization (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Provides a mechanism for serializing data without knowing the concrete type at compile time. This is achieved through dynamic dispatch, requiring a mutable reference to a `dyn Serializer`. Returns a `Result` indicating success or failure. ```rust fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error> ``` -------------------------------- ### Set Foreground Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Sets the foreground color of the text. This function takes various color enum variants as input and returns a display struct for further chaining. It is a fundamental operation for text styling. ```rust fn red(&self) -> FgColorDisplay<'_, Red, Self> fn green(&self) -> FgColorDisplay<'_, Green, Self> fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self> fn blue(&self) -> FgColorDisplay<'_, Blue, Self> fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self> fn purple(&self) -> FgColorDisplay<'_, Magenta, Self> fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self> fn white(&self) -> FgColorDisplay<'_, White, Self> fn default_color(&self) -> FgColorDisplay<'_, Default, Self> fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self> fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self> fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self> fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self> fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self> fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self> fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self> fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self> fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self> ``` -------------------------------- ### Set Truecolor Background (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Sets the background color using provided R, G, and B byte values. This function enables dynamic setting of background colors with precise RGB values. ```rust fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self> ``` -------------------------------- ### StreamMessage Clone Implementation (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Provides implementations for the `Clone` trait for the `StreamMessage` enum, allowing messages to be duplicated. ```rust impl Clone for StreamMessage fn clone(&self) -> StreamMessage fn clone_from(&mut self, source: &Self) ``` -------------------------------- ### IntoEither Implementation for Generic Types (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/struct Details the `IntoEither` trait implementation for generic types `T`, allowing conversion into `Either` variants based on a condition. ```rust fn into_either(self, into_left: bool) -> Either ``` ```rust fn into_either_with(self, into_left: F) -> Either where F: FnOnce(&Self) -> bool, ``` -------------------------------- ### Set Foreground Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Functions to set the foreground color of the text to various predefined colors. ```rust fn red(&self) -> FgColorDisplay<'_, Red, Self> fn green(&self) -> FgColorDisplay<'_, Green, Self> fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self> fn blue(&self) -> FgColorDisplay<'_, Blue, Self> fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self> fn purple(&self) -> FgColorDisplay<'_, Magenta, Self> fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self> fn white(&self) -> FgColorDisplay<'_, White, Self> fn default_color(&self) -> FgColorDisplay<'_, Default, Self> fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self> fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self> fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self> fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self> fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self> fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self> fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self> fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self> fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self> ``` -------------------------------- ### Set Background RGB Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Sets the background color using specific RGB values determined at compile-time through const generics. This function allows for exact background color specification. ```rust fn bg_rgb( &self, ) -> BgColorDisplay<'_, CustomColor, Self> ``` -------------------------------- ### Set Runtime Foreground Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Sets the foreground color of text at runtime. This function is useful when the color is not known at compile-time. For compile-time constants, prefer `OwoColorize::fg` or specific color methods. ```rust fn color(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self> where Color: DynColor, ``` -------------------------------- ### Set Truecolor Foreground (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Sets the foreground color using provided R, G, and B byte values. This method allows for dynamic RGB color setting without compile-time generics. ```rust fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self> ``` -------------------------------- ### StreamMessage Debug Implementation (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Implements the `Debug` trait for `StreamMessage`, enabling formatted output for debugging purposes. ```rust impl Debug for StreamMessage fn fmt(&self, f: &mut Formatter<'_>) -> Result ``` -------------------------------- ### StreamMessage Serialize Implementation (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Implements the `Serialize` trait from the Serde library for `StreamMessage`, enabling it to be serialized into various data formats. ```rust impl Serialize for StreamMessage fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where __S: Serializer ``` -------------------------------- ### Set Foreground RGB Color (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Sets the foreground color using specific RGB values defined at compile-time via const generics. This provides a direct way to apply a precise color. ```rust fn fg_rgb( &self, ) -> FgColorDisplay<'_, CustomColor, Self> ``` -------------------------------- ### StreamMessage Deserialize Implementation (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Implements the `Deserialize` trait from the Serde library for `StreamMessage`, allowing it to be deserialized from various data formats. ```rust impl<'de> Deserialize<'de> for StreamMessage fn deserialize<__D>(__deserializer: __D) -> Result where __D: Deserializer<'de> ``` -------------------------------- ### Serialize Dynamically (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Provides a mechanism for serializing data dynamically. This is particularly useful when the exact type or structure is not known at compile time. ```rust fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error> ``` ```rust fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl> ``` -------------------------------- ### Create Owned Data (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Implements the `ToOwned` trait, allowing the creation of owned data from borrowed data, typically through cloning. It defines the `Owned` type alias and the `to_owned` method. ```rust type Owned = T; fn to_owned(&self) -> T; fn clone_into(&self, target: &mut T); ``` -------------------------------- ### StreamMessage Enum Definition (Rust) Source: https://docs.rs/nu-plugin-protocol/latest/nu_plugin_protocol/enum Defines the `StreamMessage` enum, which represents control or data messages for a stream. It includes variants for sending data, signaling the end of a stream, dropping a stream, and acknowledging message consumption. ```rust pub enum StreamMessage { Data(StreamId, StreamData), End(StreamId), Drop(StreamId), Ack(StreamId), } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.