kcl_lib::ast::types

Struct Node

Source
pub struct Node<T> {
    pub inner: T,
    pub start: usize,
    pub end: usize,
    pub module_id: ModuleId,
}

Fields§

§inner: T§start: usize§end: usize§module_id: ModuleId

Implementations§

Source§

impl Node<IfExpression>

Source

pub fn get_constraint_level(&self) -> ConstraintLevel

Get the constraint level.

Source§

impl Node<MemberExpression>

Source

pub fn get_result_array( &self, exec_state: &mut ExecState, index: usize, ) -> Result<KclValue, KclError>

Source

pub fn get_result( &self, exec_state: &mut ExecState, ) -> Result<KclValue, KclError>

Source§

impl Node<BinaryExpression>

Source

pub fn get_result<'life0, 'life1, 'life_self, 'async_recursion>( &'life_self self, exec_state: &'life0 mut ExecState, ctx: &'life1 ExecutorContext, ) -> Pin<Box<dyn Future<Output = Result<KclValue, KclError>> + Send + 'async_recursion>>
where 'life0: 'async_recursion, 'life1: 'async_recursion, 'life_self: 'async_recursion,

Source§

impl Node<UnaryExpression>

Source

pub async fn get_result( &self, exec_state: &mut ExecState, ctx: &ExecutorContext, ) -> Result<KclValue, KclError>

Source§

impl Node<CallExpression>

Source

pub fn execute<'life0, 'life1, 'life_self, 'async_recursion>( &'life_self self, exec_state: &'life0 mut ExecState, ctx: &'life1 ExecutorContext, ) -> Pin<Box<dyn Future<Output = Result<KclValue, KclError>> + Send + 'async_recursion>>
where 'life0: 'async_recursion, 'life1: 'async_recursion, 'life_self: 'async_recursion,

Source§

impl Node<TagDeclarator>

Source

pub async fn execute( &self, exec_state: &mut ExecState, ) -> Result<KclValue, KclError>

Source§

impl Node<ArrayExpression>

Source

pub fn execute<'life0, 'life1, 'life_self, 'async_recursion>( &'life_self self, exec_state: &'life0 mut ExecState, ctx: &'life1 ExecutorContext, ) -> Pin<Box<dyn Future<Output = Result<KclValue, KclError>> + Send + 'async_recursion>>
where 'life0: 'async_recursion, 'life1: 'async_recursion, 'life_self: 'async_recursion,

Source§

impl Node<ArrayRangeExpression>

Source

pub fn execute<'life0, 'life1, 'life_self, 'async_recursion>( &'life_self self, exec_state: &'life0 mut ExecState, ctx: &'life1 ExecutorContext, ) -> Pin<Box<dyn Future<Output = Result<KclValue, KclError>> + Send + 'async_recursion>>
where 'life0: 'async_recursion, 'life1: 'async_recursion, 'life_self: 'async_recursion,

Source§

impl Node<ObjectExpression>

Source

pub fn execute<'life0, 'life1, 'life_self, 'async_recursion>( &'life_self self, exec_state: &'life0 mut ExecState, ctx: &'life1 ExecutorContext, ) -> Pin<Box<dyn Future<Output = Result<KclValue, KclError>> + Send + 'async_recursion>>
where 'life0: 'async_recursion, 'life1: 'async_recursion, 'life_self: 'async_recursion,

Source§

impl Node<IfExpression>

Source

pub fn get_result<'life0, 'life1, 'life_self, 'async_recursion>( &'life_self self, exec_state: &'life0 mut ExecState, ctx: &'life1 ExecutorContext, ) -> Pin<Box<dyn Future<Output = Result<KclValue, KclError>> + Send + 'async_recursion>>
where 'life0: 'async_recursion, 'life1: 'async_recursion, 'life_self: 'async_recursion,

Source§

impl Node<KclNone>

Source

pub fn get_constraint_level(&self) -> ConstraintLevel

Get the constraint level. KCL None is never constrained.

Source§

impl<T> Node<T>

Source

pub fn new(inner: T, start: usize, end: usize, module_id: ModuleId) -> Self

Source

pub fn no_src(inner: T) -> Self

Source

pub fn boxed( inner: T, start: usize, end: usize, module_id: ModuleId, ) -> BoxNode<T>

Source

pub fn as_source_ranges(&self) -> Vec<SourceRange>

Source§

impl Node<Program>

Source

pub fn completion_items<'a>(&'a self) -> Result<Vec<CompletionItem>>

Walk the ast and get all the variables and tags as completion items.

Source

pub fn get_lsp_symbols<'a>(&'a self, code: &str) -> Result<Vec<DocumentSymbol>>

Returns all the lsp symbols in the program.

Source

pub fn lint<'a, RuleT>(&'a self, rule: RuleT) -> Result<Vec<Discovered>>
where RuleT: Rule<'a>,

Check the provided Program for any lint findings.

Source

pub fn lint_all(&self) -> Result<Vec<Discovered>>

Source§

impl Node<NonCodeNode>

Source

pub fn contains(&self, pos: usize) -> bool

Source

pub fn format(&self, indentation: &str) -> String

Source§

impl Node<ImportItem>

Source

pub fn rename_symbol(&mut self, new_name: &str, pos: usize) -> Option<String>

Source§

impl Node<ImportStatement>

Source

pub fn get_constraint_level(&self) -> ConstraintLevel

Source

pub fn rename_symbol(&mut self, new_name: &str, pos: usize) -> Option<String>

Source§

impl Node<CallExpression>

Source

pub fn get_constraint_level(&self) -> ConstraintLevel

Return the constraint level for this call expression.

Source§

impl Node<VariableDeclaration>

Source

pub fn get_lsp_folding_range(&self) -> Option<FoldingRange>

Source

pub fn rename_symbol(&mut self, new_name: &str, pos: usize) -> Option<String>

Rename the variable declaration at the given position. This returns the old name of the variable, if it found one.

Source§

impl Node<Literal>

Source

pub fn get_constraint_level(&self) -> ConstraintLevel

Get the constraint level for this literal. Literals are always not constrained.

Source§

impl Node<Identifier>

Source

pub fn get_constraint_level(&self) -> ConstraintLevel

Get the constraint level for this identifier. Identifier are always fully constrained.

Source§

impl Node<TagDeclarator>

Source

pub fn get_constraint_level(&self) -> ConstraintLevel

Get the constraint level for this identifier. TagDeclarator are always fully constrained.

Source

pub fn get_lsp_symbols(&self, code: &str) -> Vec<DocumentSymbol>

Source§

impl Node<ArrayExpression>

Source§

impl Node<ArrayRangeExpression>

Source§

impl Node<ObjectExpression>

Source§

impl Node<ObjectProperty>

Source

pub fn get_lsp_symbols(&self, code: &str) -> Vec<DocumentSymbol>

Source§

impl Node<MemberExpression>

Source

pub fn get_constraint_level(&self) -> ConstraintLevel

Get the constraint level for a member expression. This is always fully constrained.

Source§

impl Node<BinaryExpression>

Source§

impl Node<PipeExpression>

Source

pub fn get_constraint_level(&self) -> ConstraintLevel

Source

pub fn get_result<'life0, 'life1, 'life_self, 'async_recursion>( &'life_self self, exec_state: &'life0 mut ExecState, ctx: &'life1 ExecutorContext, ) -> Pin<Box<dyn Future<Output = Result<KclValue, KclError>> + Send + 'async_recursion>>
where 'life0: 'async_recursion, 'life1: 'async_recursion, 'life_self: 'async_recursion,

Source§

impl Node<FunctionExpression>

Source

pub fn get_constraint_level(&self) -> ConstraintLevel

Function expressions don’t really apply.

Trait Implementations§

Source§

impl<T> Bake for Node<T>
where T: Bake,

Source§

fn bake(&self, env: &CrateEnv) -> TokenStream

Returns a TokenStream that would evaluate to self. Read more
Source§

impl<T: Clone> Clone for Node<T>

Source§

fn clone(&self) -> Node<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Node<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default> Default for Node<T>

Source§

fn default() -> Node<T>

Returns the “default value” for a type. Read more
Source§

impl<T> DerefMut for Node<T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'de, T> Deserialize<'de> for Node<T>
where T: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T: Display> Display for Node<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a Node<ArrayExpression>> for Node<'a>

Source§

fn from(v: NodeRef<'a, ArrayExpression>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<ArrayRangeExpression>> for Node<'a>

Source§

fn from(v: NodeRef<'a, ArrayRangeExpression>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<BinaryExpression>> for Node<'a>

Source§

fn from(v: NodeRef<'a, BinaryExpression>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<CallExpression>> for Node<'a>

Source§

fn from(v: NodeRef<'a, CallExpression>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<ExpressionStatement>> for Node<'a>

Source§

fn from(v: NodeRef<'a, ExpressionStatement>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<FunctionExpression>> for Node<'a>

Source§

fn from(v: NodeRef<'a, FunctionExpression>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<Identifier>> for Node<'a>

Source§

fn from(v: NodeRef<'a, Identifier>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<IfExpression>> for Node<'a>

Source§

fn from(v: NodeRef<'a, IfExpression>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<ImportStatement>> for Node<'a>

Source§

fn from(v: NodeRef<'a, ImportStatement>) -> Self

Converts to this type from the input type.
Source§

impl From<&Node<KclNone>> for KclValue

Source§

fn from(none: &Node<KclNone>) -> Self

Converts to this type from the input type.
Source§

impl From<&Node<Literal>> for KclValue

Source§

fn from(literal: &Node<Literal>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<Literal>> for Node<'a>

Source§

fn from(v: NodeRef<'a, Literal>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<MemberExpression>> for Node<'a>

Source§

fn from(v: NodeRef<'a, MemberExpression>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<ObjectExpression>> for Node<'a>

Source§

fn from(v: NodeRef<'a, ObjectExpression>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<ObjectProperty>> for Node<'a>

Source§

fn from(v: NodeRef<'a, ObjectProperty>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<PipeExpression>> for Node<'a>

Source§

fn from(v: NodeRef<'a, PipeExpression>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<PipeSubstitution>> for Node<'a>

Source§

fn from(v: NodeRef<'a, PipeSubstitution>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<Program>> for Node<'a>

Source§

fn from(v: NodeRef<'a, Program>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<ReturnStatement>> for Node<'a>

Source§

fn from(v: NodeRef<'a, ReturnStatement>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<&Node<T>> for Metadata

Source§

fn from(node: NodeRef<'_, T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<&Node<T>> for SourceRange

Source§

fn from(v: &Node<T>) -> Self

Converts to this type from the input type.
Source§

impl From<&Node<TagDeclarator>> for CompletionItem

Source§

fn from(tag: &Node<TagDeclarator>) -> Self

Converts to this type from the input type.
Source§

impl From<&Node<TagDeclarator>> for KclValue

Source§

fn from(tag: &Node<TagDeclarator>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<TagDeclarator>> for Node<'a>

Source§

fn from(v: NodeRef<'a, TagDeclarator>) -> Self

Converts to this type from the input type.
Source§

impl From<&Node<TagDeclarator>> for TagIdentifier

Source§

fn from(tag: &Node<TagDeclarator>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<UnaryExpression>> for Node<'a>

Source§

fn from(v: NodeRef<'a, UnaryExpression>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<VariableDeclaration>> for Node<'a>

Source§

fn from(v: NodeRef<'a, VariableDeclaration>) -> Self

Converts to this type from the input type.
Source§

impl From<&Node<VariableDeclaration>> for Vec<CompletionItem>

Source§

fn from(declaration: &Node<VariableDeclaration>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Node<VariableDeclarator>> for Node<'a>

Source§

fn from(v: NodeRef<'a, VariableDeclarator>) -> Self

Converts to this type from the input type.
Source§

impl From<Node<ArrayExpression>> for Expr

Source§

fn from(array_expression: Node<ArrayExpression>) -> Self

Converts to this type from the input type.
Source§

impl From<Node<ArrayRangeExpression>> for Expr

Source§

fn from(array_expression: Node<ArrayRangeExpression>) -> Self

Converts to this type from the input type.
Source§

impl From<Node<CallExpression>> for Expr

Source§

fn from(call_expression: Node<CallExpression>) -> Self

Converts to this type from the input type.
Source§

impl From<Node<Literal>> for Expr

Source§

fn from(literal: Node<Literal>) -> Self

Converts to this type from the input type.
Source§

impl From<Node<Literal>> for KclValue

Source§

fn from(literal: Node<Literal>) -> Self

Converts to this type from the input type.
Source§

impl From<Node<PipeExpression>> for Expr

Source§

fn from(pipe_expression: Node<PipeExpression>) -> Self

Converts to this type from the input type.
Source§

impl From<Node<PipeSubstitution>> for Expr

Source§

fn from(pipe_substitution: Node<PipeSubstitution>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Node<T>> for SourceRange

Source§

fn from(v: Node<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: JsonSchema> JsonSchema for Node<T>

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

impl<T: PartialEq> PartialEq for Node<T>

Source§

fn eq(&self, other: &Node<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> Serialize for Node<T>
where T: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T> TS for Node<T>
where T: TS,

Source§

type WithoutGenerics = Node<Dummy>

If this type does not have generic parameters, then WithoutGenerics should just be Self. If the type does have generic parameters, then all generic parameters must be replaced with a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that EXPORT_TO must be None. Read more
Source§

fn ident() -> String

Identifier of this type, excluding generic parameters.
Source§

fn name() -> String

Name of this type in TypeScript, including generic parameters
Source§

fn decl_concrete() -> String

Declaration of this type using the supplied generic arguments. The resulting TypeScript definition will not be generic. For that, see TS::decl(). If this type is not generic, then this function is equivalent to TS::decl().
Source§

fn decl() -> String

Declaration of this type, e.g. type User = { user_id: number, ... }. This function will panic if the type has no declaration. Read more
Source§

fn inline() -> String

Formats this types definition in TypeScript, e.g { user_id: number }. This function will panic if the type cannot be inlined.
Source§

fn inline_flattened() -> String

Flatten a type declaration.
This function will panic if the type cannot be flattened.
Source§

fn visit_generics(v: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all type parameters of this type.
Source§

fn output_path() -> Option<&'static Path>

Returns the output path to where T should be exported.
The returned path does not include the base directory from TS_RS_EXPORT_DIR. Read more
Source§

fn visit_dependencies(v: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all dependency of this type.
Source§

const DOCS: Option<&'static str> = None

JSDoc comment to describe this type in TypeScript - when TS is derived, docs are automatically read from your doc comments or #[doc = ".."] attributes
Source§

fn dependencies() -> Vec<Dependency>
where Self: 'static,

Resolves all dependencies of this type recursively.
Source§

fn export() -> Result<(), ExportError>
where Self: 'static,

Manually export this type to the filesystem. To export this type together with all of its dependencies, use TS::export_all. Read more
Source§

fn export_all() -> Result<(), ExportError>
where Self: 'static,

Manually export this type to the filesystem, together with all of its dependencies.
To export only this type, without its dependencies, use TS::export. Read more
Source§

fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>
where Self: 'static,

Manually export this type into the given directory, together with all of its dependencies.
To export only this type, without its dependencies, use TS::export. Read more
Source§

fn export_to_string() -> Result<String, ExportError>
where Self: 'static,

Manually generate bindings for this type, returning a String.
This function does not format the output, even if the format feature is enabled. Read more
Source§

fn default_output_path() -> Option<PathBuf>

Returns the output path to where T should be exported. Read more
Source§

impl TryFrom<Token> for Node<Identifier>

Source§

type Error = KclError

The type returned in the event of a conversion error.
Source§

fn try_from(token: Token) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Token> for Node<TagDeclarator>

Source§

type Error = KclError

The type returned in the event of a conversion error.
Source§

fn try_from(token: Token) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T> Deref for Node<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: Eq> Eq for Node<T>

Source§

impl<T> StructuralPartialEq for Node<T>

Auto Trait Implementations§

§

impl<T> Freeze for Node<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Node<T>
where T: RefUnwindSafe,

§

impl<T> Send for Node<T>
where T: Send,

§

impl<T> Sync for Node<T>
where T: Sync,

§

impl<T> Unpin for Node<T>
where T: Unpin,

§

impl<T> UnwindSafe for Node<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromArgs<'a> for T
where T: FromKclValue<'a>,

Source§

fn from_args(args: &'a Args, i: usize) -> Result<T, KclError>

Get this type from the args passed into a KCL function, at the given index in the argument list.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoResult<T> for T

Source§

impl<T> IntoResult<T> for T

Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ValidateIp for T
where T: ToString,

Source§

fn validate_ipv4(&self) -> bool

Validates whether the given string is an IP V4
Source§

fn validate_ipv6(&self) -> bool

Validates whether the given string is an IP V6
Source§

fn validate_ip(&self) -> bool

Validates whether the given string is an IP
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> Parsable for T
where T: Deref, <T as Deref>::Target: Parsable,