pub struct ConnCatalog<'a> {
state: Cow<'a, CatalogState>,
unresolvable_ids: BTreeSet<CatalogItemId>,
conn_id: ConnectionId,
cluster: String,
database: Option<DatabaseId>,
search_path: Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>,
role_id: RoleId,
prepared_statements: Option<&'a BTreeMap<String, PreparedStatement>>,
notices_tx: UnboundedSender<AdapterNotice>,
}
Fields§
§state: Cow<'a, CatalogState>
§unresolvable_ids: BTreeSet<CatalogItemId>
Because we don’t have any way of removing items from the catalog temporarily, we allow the ConnCatalog to pretend that a set of items don’t exist during resolution.
This feature is necessary to allow re-planning of statements, which is either incredibly useful or required when altering item definitions.
Note that uses of this field should be used by short-lived catalogs.
conn_id: ConnectionId
§cluster: String
§database: Option<DatabaseId>
§search_path: Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>
§role_id: RoleId
§prepared_statements: Option<&'a BTreeMap<String, PreparedStatement>>
§notices_tx: UnboundedSender<AdapterNotice>
Implementations§
Source§impl ConnCatalog<'_>
impl ConnCatalog<'_>
pub fn conn_id(&self) -> &ConnectionId
pub fn state(&self) -> &CatalogState
Sourcepub fn mark_id_unresolvable_for_replanning(&mut self, id: CatalogItemId)
pub fn mark_id_unresolvable_for_replanning(&mut self, id: CatalogItemId)
Prevent planning from resolving item with the provided ID. Instead, return an error as if the item did not exist.
This feature is meant exclusively to permit re-planning statements during update operations and should not be used otherwise given its extremely “powerful” semantics.
§Panics
If the catalog’s role ID is not MZ_SYSTEM_ROLE_ID
.
Sourcepub fn effective_search_path(
&self,
include_temp_schema: bool,
) -> Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>
pub fn effective_search_path( &self, include_temp_schema: bool, ) -> Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>
Returns the schemas:
- mz_catalog
- pg_catalog
- temp (if requested)
- all schemas from the session’s search_path var that exist
Source§impl ConnCatalog<'_>
impl ConnCatalog<'_>
fn resolve_item_name( &self, name: &PartialItemName, ) -> Result<&QualifiedItemName, SqlCatalogError>
fn resolve_function_name( &self, name: &PartialItemName, ) -> Result<&QualifiedItemName, SqlCatalogError>
fn resolve_type_name( &self, name: &PartialItemName, ) -> Result<&QualifiedItemName, SqlCatalogError>
Trait Implementations§
Source§impl ConnectionResolver for ConnCatalog<'_>
impl ConnectionResolver for ConnCatalog<'_>
fn resolve_connection(&self, id: CatalogItemId) -> Connection<InlinedConnection>
Source§impl<'a> Debug for ConnCatalog<'a>
impl<'a> Debug for ConnCatalog<'a>
Source§impl ExprHumanizer for ConnCatalog<'_>
impl ExprHumanizer for ConnCatalog<'_>
Source§fn humanize_id(&self, id: GlobalId) -> Option<String>
fn humanize_id(&self, id: GlobalId) -> Option<String>
id
.Source§fn humanize_id_unqualified(&self, id: GlobalId) -> Option<String>
fn humanize_id_unqualified(&self, id: GlobalId) -> Option<String>
foo
for materialize.public.foo
.Source§fn humanize_id_parts(&self, id: GlobalId) -> Option<Vec<String>>
fn humanize_id_parts(&self, id: GlobalId) -> Option<Vec<String>>
Self::humanize_id
, but returns the constituent parts of the
name as individual elements.Source§fn humanize_scalar_type(
&self,
typ: &SqlScalarType,
postgres_compat: bool,
) -> String
fn humanize_scalar_type( &self, typ: &SqlScalarType, postgres_compat: bool, ) -> String
pg_typeof
, where Postgres
compatibility is more important.Source§fn column_names_for_id(&self, id: GlobalId) -> Option<Vec<String>>
fn column_names_for_id(&self, id: GlobalId) -> Option<Vec<String>>
id
.Source§fn humanize_column(&self, id: GlobalId, column: usize) -> Option<String>
fn humanize_column(&self, id: GlobalId, column: usize) -> Option<String>
#column
name for the relation identified by id
.Source§fn humanize_column_type(
&self,
typ: &SqlColumnType,
postgres_compat: bool,
) -> String
fn humanize_column_type( &self, typ: &SqlColumnType, postgres_compat: bool, ) -> String
pg_typeof
, where Postgres
compatibility is more important.Source§impl SessionCatalog for ConnCatalog<'_>
impl SessionCatalog for ConnCatalog<'_>
Source§fn minimal_qualification(
&self,
qualified_name: &QualifiedItemName,
) -> PartialItemName
fn minimal_qualification( &self, qualified_name: &QualifiedItemName, ) -> PartialItemName
Returns a PartialItemName
with the minimum amount of qualifiers to unambiguously resolve
the object.
Source§fn active_role_id(&self) -> &RoleId
fn active_role_id(&self) -> &RoleId
Source§fn get_prepared_statement_desc(&self, name: &str) -> Option<&StatementDesc>
fn get_prepared_statement_desc(&self, name: &str) -> Option<&StatementDesc>
Source§fn active_database(&self) -> Option<&DatabaseId>
fn active_database(&self) -> Option<&DatabaseId>
Source§fn active_cluster(&self) -> &str
fn active_cluster(&self) -> &str
Source§fn search_path(&self) -> &[(ResolvedDatabaseSpecifier, SchemaSpecifier)]
fn search_path(&self) -> &[(ResolvedDatabaseSpecifier, SchemaSpecifier)]
Source§fn resolve_database(
&self,
database_name: &str,
) -> Result<&dyn CatalogDatabase, SqlCatalogError>
fn resolve_database( &self, database_name: &str, ) -> Result<&dyn CatalogDatabase, SqlCatalogError>
Source§fn get_database(&self, id: &DatabaseId) -> &dyn CatalogDatabase
fn get_database(&self, id: &DatabaseId) -> &dyn CatalogDatabase
Source§fn get_databases(&self) -> Vec<&dyn CatalogDatabase>
fn get_databases(&self) -> Vec<&dyn CatalogDatabase>
Source§fn resolve_schema(
&self,
database_name: Option<&str>,
schema_name: &str,
) -> Result<&dyn CatalogSchema, SqlCatalogError>
fn resolve_schema( &self, database_name: Option<&str>, schema_name: &str, ) -> Result<&dyn CatalogSchema, SqlCatalogError>
Source§fn resolve_schema_in_database(
&self,
database_spec: &ResolvedDatabaseSpecifier,
schema_name: &str,
) -> Result<&dyn CatalogSchema, SqlCatalogError>
fn resolve_schema_in_database( &self, database_spec: &ResolvedDatabaseSpecifier, schema_name: &str, ) -> Result<&dyn CatalogSchema, SqlCatalogError>
Source§fn get_schema(
&self,
database_spec: &ResolvedDatabaseSpecifier,
schema_spec: &SchemaSpecifier,
) -> &dyn CatalogSchema
fn get_schema( &self, database_spec: &ResolvedDatabaseSpecifier, schema_spec: &SchemaSpecifier, ) -> &dyn CatalogSchema
Source§fn get_schemas(&self) -> Vec<&dyn CatalogSchema>
fn get_schemas(&self) -> Vec<&dyn CatalogSchema>
Source§fn get_mz_internal_schema_id(&self) -> SchemaId
fn get_mz_internal_schema_id(&self) -> SchemaId
Source§fn get_mz_unsafe_schema_id(&self) -> SchemaId
fn get_mz_unsafe_schema_id(&self) -> SchemaId
Source§fn is_system_schema_specifier(&self, schema: SchemaSpecifier) -> bool
fn is_system_schema_specifier(&self, schema: SchemaSpecifier) -> bool
schema
is an internal system schema, false otherwiseSource§fn resolve_role(
&self,
role_name: &str,
) -> Result<&dyn CatalogRole, SqlCatalogError>
fn resolve_role( &self, role_name: &str, ) -> Result<&dyn CatalogRole, SqlCatalogError>
Source§fn resolve_network_policy(
&self,
policy_name: &str,
) -> Result<&dyn CatalogNetworkPolicy, SqlCatalogError>
fn resolve_network_policy( &self, policy_name: &str, ) -> Result<&dyn CatalogNetworkPolicy, SqlCatalogError>
Source§fn try_get_role(&self, id: &RoleId) -> Option<&dyn CatalogRole>
fn try_get_role(&self, id: &RoleId) -> Option<&dyn CatalogRole>
Source§fn get_roles(&self) -> Vec<&dyn CatalogRole>
fn get_roles(&self) -> Vec<&dyn CatalogRole>
Source§fn mz_system_role_id(&self) -> RoleId
fn mz_system_role_id(&self) -> RoleId
mz_system
role.Source§fn collect_role_membership(&self, id: &RoleId) -> BTreeSet<RoleId>
fn collect_role_membership(&self, id: &RoleId) -> BTreeSet<RoleId>
id
is transitively a member of.Source§fn get_network_policy(&self, id: &NetworkPolicyId) -> &dyn CatalogNetworkPolicy
fn get_network_policy(&self, id: &NetworkPolicyId) -> &dyn CatalogNetworkPolicy
Source§fn get_network_policies(&self) -> Vec<&dyn CatalogNetworkPolicy>
fn get_network_policies(&self) -> Vec<&dyn CatalogNetworkPolicy>
Source§fn resolve_cluster(
&self,
cluster_name: Option<&str>,
) -> Result<&dyn CatalogCluster<'_>, SqlCatalogError>
fn resolve_cluster( &self, cluster_name: Option<&str>, ) -> Result<&dyn CatalogCluster<'_>, SqlCatalogError>
None
, resolves the currently active cluster.Source§fn resolve_cluster_replica(
&self,
cluster_replica_name: &QualifiedReplica,
) -> Result<&dyn CatalogClusterReplica<'_>, SqlCatalogError>
fn resolve_cluster_replica( &self, cluster_replica_name: &QualifiedReplica, ) -> Result<&dyn CatalogClusterReplica<'_>, SqlCatalogError>
Source§fn resolve_item(
&self,
name: &PartialItemName,
) -> Result<&dyn CatalogItem, SqlCatalogError>
fn resolve_item( &self, name: &PartialItemName, ) -> Result<&dyn CatalogItem, SqlCatalogError>
Source§fn resolve_function(
&self,
name: &PartialItemName,
) -> Result<&dyn CatalogItem, SqlCatalogError>
fn resolve_function( &self, name: &PartialItemName, ) -> Result<&dyn CatalogItem, SqlCatalogError>
SessionCatalog::resolve_item
but for
functions within the catalog.Source§fn resolve_type(
&self,
name: &PartialItemName,
) -> Result<&dyn CatalogItem, SqlCatalogError>
fn resolve_type( &self, name: &PartialItemName, ) -> Result<&dyn CatalogItem, SqlCatalogError>
SessionCatalog::resolve_item
but for
types within the catalog.Source§fn get_system_type(&self, name: &str) -> &dyn CatalogItem
fn get_system_type(&self, name: &str) -> &dyn CatalogItem
name
from exactly one of the system schemas. Read moreSource§fn try_get_item(&self, id: &CatalogItemId) -> Option<&dyn CatalogItem>
fn try_get_item(&self, id: &CatalogItemId) -> Option<&dyn CatalogItem>
Source§fn try_get_item_by_global_id(
&self,
id: &GlobalId,
) -> Option<Box<dyn CatalogCollectionItem>>
fn try_get_item_by_global_id( &self, id: &GlobalId, ) -> Option<Box<dyn CatalogCollectionItem>>
Source§fn get_item(&self, id: &CatalogItemId) -> &dyn CatalogItem
fn get_item(&self, id: &CatalogItemId) -> &dyn CatalogItem
Source§fn get_item_by_global_id(&self, id: &GlobalId) -> Box<dyn CatalogCollectionItem>
fn get_item_by_global_id(&self, id: &GlobalId) -> Box<dyn CatalogCollectionItem>
Source§fn get_items(&self) -> Vec<&dyn CatalogItem>
fn get_items(&self) -> Vec<&dyn CatalogItem>
Source§fn get_item_by_name(
&self,
name: &QualifiedItemName,
) -> Option<&dyn SqlCatalogItem>
fn get_item_by_name( &self, name: &QualifiedItemName, ) -> Option<&dyn SqlCatalogItem>
Source§fn get_type_by_name(
&self,
name: &QualifiedItemName,
) -> Option<&dyn SqlCatalogItem>
fn get_type_by_name( &self, name: &QualifiedItemName, ) -> Option<&dyn SqlCatalogItem>
Source§fn get_cluster(&self, id: ClusterId) -> &dyn CatalogCluster<'_>
fn get_cluster(&self, id: ClusterId) -> &dyn CatalogCluster<'_>
Source§fn get_clusters(&self) -> Vec<&dyn CatalogCluster<'_>>
fn get_clusters(&self) -> Vec<&dyn CatalogCluster<'_>>
Source§fn get_cluster_replica(
&self,
cluster_id: ClusterId,
replica_id: ReplicaId,
) -> &dyn CatalogClusterReplica<'_>
fn get_cluster_replica( &self, cluster_id: ClusterId, replica_id: ReplicaId, ) -> &dyn CatalogClusterReplica<'_>
Source§fn get_cluster_replicas(&self) -> Vec<&dyn CatalogClusterReplica<'_>>
fn get_cluster_replicas(&self) -> Vec<&dyn CatalogClusterReplica<'_>>
Source§fn get_system_privileges(&self) -> &PrivilegeMap
fn get_system_privileges(&self) -> &PrivilegeMap
Source§fn get_default_privileges(
&self,
) -> Vec<(&DefaultPrivilegeObject, Vec<&DefaultPrivilegeAclItem>)>
fn get_default_privileges( &self, ) -> Vec<(&DefaultPrivilegeObject, Vec<&DefaultPrivilegeAclItem>)>
Source§fn find_available_name(&self, name: QualifiedItemName) -> QualifiedItemName
fn find_available_name(&self, name: QualifiedItemName) -> QualifiedItemName
name
that is not already in use. Read moreSource§fn resolve_full_name(&self, name: &QualifiedItemName) -> FullItemName
fn resolve_full_name(&self, name: &QualifiedItemName) -> FullItemName
Source§fn resolve_full_schema_name(&self, name: &QualifiedSchemaName) -> FullSchemaName
fn resolve_full_schema_name(&self, name: &QualifiedSchemaName) -> FullSchemaName
Source§fn resolve_item_id(&self, global_id: &GlobalId) -> CatalogItemId
fn resolve_item_id(&self, global_id: &GlobalId) -> CatalogItemId
CatalogItemId
for from a GlobalId
.Source§fn resolve_global_id(
&self,
item_id: &CatalogItemId,
version: RelationVersionSelector,
) -> GlobalId
fn resolve_global_id( &self, item_id: &CatalogItemId, version: RelationVersionSelector, ) -> GlobalId
GlobalId
for the specificed Catalog Item, at the specified version.Source§fn config(&self) -> &CatalogConfig
fn config(&self) -> &CatalogConfig
Source§fn now(&self) -> EpochMillis
fn now(&self) -> EpochMillis
Source§fn aws_privatelink_availability_zones(&self) -> Option<BTreeSet<String>>
fn aws_privatelink_availability_zones(&self) -> Option<BTreeSet<String>>
Source§fn system_vars(&self) -> &SystemVars
fn system_vars(&self) -> &SystemVars
Source§fn system_vars_mut(&mut self) -> &mut SystemVars
fn system_vars_mut(&mut self) -> &mut SystemVars
Source§fn get_owner_id(&self, id: &ObjectId) -> Option<RoleId>
fn get_owner_id(&self, id: &ObjectId) -> Option<RoleId>
RoleId
of the owner of an object by its ID.Source§fn get_privileges(&self, id: &SystemObjectId) -> Option<&PrivilegeMap>
fn get_privileges(&self, id: &SystemObjectId) -> Option<&PrivilegeMap>
PrivilegeMap
of the object.Source§fn item_dependents(&self, id: CatalogItemId) -> Vec<ObjectId>
fn item_dependents(&self, id: CatalogItemId) -> Vec<ObjectId>
Source§fn all_object_privileges(&self, object_type: SystemObjectType) -> AclMode
fn all_object_privileges(&self, object_type: SystemObjectType) -> AclMode
Source§fn get_object_type(&self, object_id: &ObjectId) -> ObjectType
fn get_object_type(&self, object_id: &ObjectId) -> ObjectType
object_id
.Source§fn get_system_object_type(&self, id: &SystemObjectId) -> SystemObjectType
fn get_system_object_type(&self, id: &SystemObjectId) -> SystemObjectType
id
.Source§fn add_notice(&self, notice: PlanNotice)
fn add_notice(&self, notice: PlanNotice)
PlanNotice
that will be displayed to the user if the plan
successfully executes.Source§fn get_item_comments(
&self,
id: &CatalogItemId,
) -> Option<&BTreeMap<Option<usize>, String>>
fn get_item_comments( &self, id: &CatalogItemId, ) -> Option<&BTreeMap<Option<usize>, String>>
id
Source§fn is_cluster_size_cc(&self, size: &str) -> bool
fn is_cluster_size_cc(&self, size: &str) -> bool
Source§fn active_database_name(&self) -> Option<&str>
fn active_database_name(&self) -> Option<&str>
Source§fn resolve_item_or_type(
&self,
name: &PartialItemName,
) -> Result<&dyn CatalogItem, CatalogError>
fn resolve_item_or_type( &self, name: &PartialItemName, ) -> Result<&dyn CatalogItem, CatalogError>
name
to a type or item, preferring the type if both exist.Auto Trait Implementations§
impl<'a> Freeze for ConnCatalog<'a>
impl<'a> !RefUnwindSafe for ConnCatalog<'a>
impl<'a> Send for ConnCatalog<'a>
impl<'a> Sync for ConnCatalog<'a>
impl<'a> Unpin for ConnCatalog<'a>
impl<'a> !UnwindSafe for ConnCatalog<'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
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
Source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.Source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.Source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
Source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.