Enum nu_protocol::ReturnSuccess
source · [−]pub enum ReturnSuccess {
Value(Value),
DebugValue(Value),
Action(CommandAction),
}
Expand description
The fundamental success type in the pipeline. Commands return these values as their main responsibility
Variants
Value(Value)
A value to be used or shown to the user
DebugValue(Value)
A debug-enabled value to be used or shown to the user
Action(CommandAction)
An action to be performed as values pass out of the command. These are performed rather than passed to the next command in the pipeline
Implementations
sourceimpl ReturnSuccess
impl ReturnSuccess
sourcepub fn change_cwd(path: String) -> ReturnValue
pub fn change_cwd(path: String) -> ReturnValue
Helper function for an action to change the the path
sourcepub fn value(input: impl Into<Value>) -> ReturnValue
pub fn value(input: impl Into<Value>) -> ReturnValue
Helper function to create simple values for returning
sourcepub fn debug_value(input: impl Into<Value>) -> ReturnValue
pub fn debug_value(input: impl Into<Value>) -> ReturnValue
Helper function to create simple debug-enabled values for returning
sourcepub fn action(input: CommandAction) -> ReturnValue
pub fn action(input: CommandAction) -> ReturnValue
Helper function for creating actions
Trait Implementations
sourceimpl Clone for ReturnSuccess
impl Clone for ReturnSuccess
sourcefn clone(&self) -> ReturnSuccess
fn clone(&self) -> ReturnSuccess
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ReturnSuccess
impl Debug for ReturnSuccess
sourceimpl<'de> Deserialize<'de> for ReturnSuccess
impl<'de> Deserialize<'de> for ReturnSuccess
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<ReturnSuccess> for ReturnSuccess
impl PartialEq<ReturnSuccess> for ReturnSuccess
sourcefn eq(&self, other: &ReturnSuccess) -> bool
fn eq(&self, other: &ReturnSuccess) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ReturnSuccess) -> bool
fn ne(&self, other: &ReturnSuccess) -> bool
This method tests for !=
.
sourceimpl PrettyDebug for ReturnSuccess
impl PrettyDebug for ReturnSuccess
sourcefn pretty(&self) -> DebugDocBuilder
fn pretty(&self) -> DebugDocBuilder
Get a return success ready to be pretty-printed
fn to_doc(&self) -> DebugDoc
fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn pretty_builder(&self) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
sourcefn display(&self) -> String
fn display(&self) -> String
A convenience method that prints out the document without colors in 70 columns. Generally, you should use plain_string or colored_string if possible, but display() can be useful for trace lines and things like that, where you don’t have control over the terminal. Read more
fn plain_string(&self, width: usize) -> String
fn colored_string(&self, width: usize) -> String
sourceimpl Serialize for ReturnSuccess
impl Serialize for ReturnSuccess
impl StructuralPartialEq for ReturnSuccess
Auto Trait Implementations
impl RefUnwindSafe for ReturnSuccess
impl Send for ReturnSuccess
impl Sync for ReturnSuccess
impl Unpin for ReturnSuccess
impl UnwindSafe for ReturnSuccess
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> PrettyDebugWithSource for T where
T: PrettyDebug,
impl<T> PrettyDebugWithSource for T where
T: PrettyDebug,
pub fn pretty_debug(&self, _source: &str) -> DebugDocBuilder
fn refined_pretty_debug(
&self,
_refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
fn debug(&self, source: impl Into<Text>) -> String where
Self: Clone,
fn debuggable(self, source: impl Into<Text>) -> DebuggableWithSource<Self>
sourceimpl<T> SpannedItem for T
impl<T> SpannedItem for T
sourceimpl<T> TaggedItem for T
impl<T> TaggedItem for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more