#[repr(C)]
pub struct QRegularExpression { /* private fields */ }
Expand description

The QRegularExpression class provides pattern matching using regular expressions.

C++ class: QRegularExpression.

C++ documentation:

The QRegularExpression class provides pattern matching using regular expressions.

Regular expressions, or regexps, are a very powerful tool to handle strings and texts. This is useful in many contexts, e.g.,

ValidationA regexp can test whether a substring meets some criteria, e.g. is an integer or contains no whitespace.
SearchingA regexp provides more powerful pattern matching than simple substring matching, e.g., match one of the words mail, letter or correspondence, but none of the words email, mailman, mailer, letterbox, etc.
Search and ReplaceA regexp can replace all occurrences of a substring with a different substring, e.g., replace all occurrences of & with & except where the & is already followed by an amp;.
String SplittingA regexp can be used to identify where a string should be split apart, e.g. splitting tab-delimited strings.

This document is by no means a complete reference to pattern matching using regular expressions, and the following parts will require the reader to have some basic knowledge about Perl-like regular expressions and their pattern syntax.

Good references about regular expressions include:

Implementations§

source§

impl QRegularExpression

source

pub unsafe fn anchored_pattern( expression: impl CastInto<Ref<QString>> ) -> CppBox<QString>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the expression wrapped between the \A and \z anchors to be used for exact matching.

Calls C++ function: static QString QRegularExpression::anchoredPattern(const QString& expression).

C++ documentation:

Returns the expression wrapped between the \A and \z anchors to be used for exact matching.

This function was introduced in Qt 5.12.

See also Porting from QRegExp's Exact Matching.

source

pub unsafe fn capture_count(&self) -> c_int

Returns the number of capturing groups inside the pattern string, or -1 if the regular expression is not valid.

Calls C++ function: int QRegularExpression::captureCount() const.

C++ documentation:

Returns the number of capturing groups inside the pattern string, or -1 if the regular expression is not valid.

Note: The implicit capturing group 0 is not included in the returned number.

See also isValid().

source

pub unsafe fn copy_from( &self, re: impl CastInto<Ref<QRegularExpression>> ) -> Ref<QRegularExpression>

Assigns the regular expression re to this object, and returns a reference to the copy. Both the pattern and the pattern options are copied.

Calls C++ function: QRegularExpression& QRegularExpression::operator=(const QRegularExpression& re).

C++ documentation:

Assigns the regular expression re to this object, and returns a reference to the copy. Both the pattern and the pattern options are copied.

source

pub unsafe fn error_string(&self) -> CppBox<QString>

Returns a textual description of the error found when checking the validity of the regular expression, or "no error" if no error was found.

Calls C++ function: QString QRegularExpression::errorString() const.

C++ documentation:

Returns a textual description of the error found when checking the validity of the regular expression, or “no error” if no error was found.

See also isValid() and patternErrorOffset().

source

pub unsafe fn escape(str: impl CastInto<Ref<QString>>) -> CppBox<QString>

Escapes all characters of str so that they no longer have any special meaning when used as a regular expression pattern string, and returns the escaped string. For instance:

Calls C++ function: static QString QRegularExpression::escape(const QString& str).

C++ documentation:

Escapes all characters of str so that they no longer have any special meaning when used as a regular expression pattern string, and returns the escaped string. For instance:


  QString escaped = QRegularExpression::escape("a(x) = f(x) + g(x)");
  // escaped == "a\\(x\\)\\ \\=\\ f\\(x\\)\\ \\+\\ g\\(x\\)"

This is very convenient in order to build patterns from arbitrary strings:

QString pattern = “(” + QRegularExpression::escape(name) + “|” + QRegularExpression::escape(nickname) + “)”; QRegularExpression re(pattern);

Note: This function implements Perl's quotemeta algorithm and escapes with a backslash all characters in str, except for the characters in the [A-Z], [a-z] and [0-9] ranges, as well as the underscore (_) character. The only difference with Perl is that a literal NUL inside str is escaped with the sequence "\\0" (backslash + '0'), instead of "\\\0" (backslash + NUL).

source

pub unsafe fn global_match_q_string_int_match_type_q_flags_match_option( &self, subject: impl CastInto<Ref<QString>>, offset: c_int, match_type: MatchType, match_options: QFlags<MatchOption> ) -> CppBox<QRegularExpressionMatchIterator>

Attempts to perform a global match of the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

Calls C++ function: QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QString& subject, int offset = …, QRegularExpression::MatchType matchType = …, QFlags<QRegularExpression::MatchOption> matchOptions = …) const.

C++ documentation:

Attempts to perform a global match of the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatchIterator is positioned before the first match result (if any).

See also QRegularExpressionMatchIterator and global matching.

source

pub unsafe fn global_match_q_string_ref_int_match_type_q_flags_match_option( &self, subject_ref: impl CastInto<Ref<QStringRef>>, offset: c_int, match_type: MatchType, match_options: QFlags<MatchOption> ) -> CppBox<QRegularExpressionMatchIterator>

This is an overloaded function.

Calls C++ function: QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QStringRef& subjectRef, int offset = …, QRegularExpression::MatchType matchType = …, QFlags<QRegularExpression::MatchOption> matchOptions = …) const.

C++ documentation:

This is an overloaded function.

Attempts to perform a global match of the regular expression against the given subjectRef string reference, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatchIterator is positioned before the first match result (if any).

This function was introduced in Qt 5.5.

See also QRegularExpressionMatchIterator and global matching.

source

pub unsafe fn global_match_q_string_int_match_type( &self, subject: impl CastInto<Ref<QString>>, offset: c_int, match_type: MatchType ) -> CppBox<QRegularExpressionMatchIterator>

Attempts to perform a global match of the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

Calls C++ function: QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QString& subject, int offset = …, QRegularExpression::MatchType matchType = …) const.

C++ documentation:

Attempts to perform a global match of the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatchIterator is positioned before the first match result (if any).

See also QRegularExpressionMatchIterator and global matching.

source

pub unsafe fn global_match_q_string_int( &self, subject: impl CastInto<Ref<QString>>, offset: c_int ) -> CppBox<QRegularExpressionMatchIterator>

Attempts to perform a global match of the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

Calls C++ function: QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QString& subject, int offset = …) const.

C++ documentation:

Attempts to perform a global match of the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatchIterator is positioned before the first match result (if any).

See also QRegularExpressionMatchIterator and global matching.

source

pub unsafe fn global_match_q_string( &self, subject: impl CastInto<Ref<QString>> ) -> CppBox<QRegularExpressionMatchIterator>

Attempts to perform a global match of the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

Calls C++ function: QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QString& subject) const.

C++ documentation:

Attempts to perform a global match of the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatchIterator is positioned before the first match result (if any).

See also QRegularExpressionMatchIterator and global matching.

source

pub unsafe fn global_match_q_string_ref_int_match_type( &self, subject_ref: impl CastInto<Ref<QStringRef>>, offset: c_int, match_type: MatchType ) -> CppBox<QRegularExpressionMatchIterator>

This is an overloaded function.

Calls C++ function: QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QStringRef& subjectRef, int offset = …, QRegularExpression::MatchType matchType = …) const.

C++ documentation:

This is an overloaded function.

Attempts to perform a global match of the regular expression against the given subjectRef string reference, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatchIterator is positioned before the first match result (if any).

This function was introduced in Qt 5.5.

See also QRegularExpressionMatchIterator and global matching.

source

pub unsafe fn global_match_q_string_ref_int( &self, subject_ref: impl CastInto<Ref<QStringRef>>, offset: c_int ) -> CppBox<QRegularExpressionMatchIterator>

This is an overloaded function.

Calls C++ function: QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QStringRef& subjectRef, int offset = …) const.

C++ documentation:

This is an overloaded function.

Attempts to perform a global match of the regular expression against the given subjectRef string reference, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatchIterator is positioned before the first match result (if any).

This function was introduced in Qt 5.5.

See also QRegularExpressionMatchIterator and global matching.

source

pub unsafe fn global_match_q_string_ref( &self, subject_ref: impl CastInto<Ref<QStringRef>> ) -> CppBox<QRegularExpressionMatchIterator>

This is an overloaded function.

Calls C++ function: QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QStringRef& subjectRef) const.

C++ documentation:

This is an overloaded function.

Attempts to perform a global match of the regular expression against the given subjectRef string reference, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatchIterator is positioned before the first match result (if any).

This function was introduced in Qt 5.5.

See also QRegularExpressionMatchIterator and global matching.

source

pub unsafe fn is_valid(&self) -> bool

Returns true if the regular expression is a valid regular expression (that is, it contains no syntax errors, etc.), or false otherwise. Use errorString() to obtain a textual description of the error.

Calls C++ function: bool QRegularExpression::isValid() const.

C++ documentation:

Returns true if the regular expression is a valid regular expression (that is, it contains no syntax errors, etc.), or false otherwise. Use errorString() to obtain a textual description of the error.

See also errorString() and patternErrorOffset().

source

pub unsafe fn match_q_string_int_match_type_q_flags_match_option( &self, subject: impl CastInto<Ref<QString>>, offset: c_int, match_type: MatchType, match_options: QFlags<MatchOption> ) -> CppBox<QRegularExpressionMatch>

Attempts to match the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

Calls C++ function: QRegularExpressionMatch QRegularExpression::match(const QString& subject, int offset = …, QRegularExpression::MatchType matchType = …, QFlags<QRegularExpression::MatchOption> matchOptions = …) const.

C++ documentation:

Attempts to match the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatch object contains the results of the match.

See also QRegularExpressionMatch and normal matching.

source

pub unsafe fn match_q_string_ref_int_match_type_q_flags_match_option( &self, subject_ref: impl CastInto<Ref<QStringRef>>, offset: c_int, match_type: MatchType, match_options: QFlags<MatchOption> ) -> CppBox<QRegularExpressionMatch>

This is an overloaded function.

Calls C++ function: QRegularExpressionMatch QRegularExpression::match(const QStringRef& subjectRef, int offset = …, QRegularExpression::MatchType matchType = …, QFlags<QRegularExpression::MatchOption> matchOptions = …) const.

C++ documentation:

This is an overloaded function.

Attempts to match the regular expression against the given subjectRef string reference, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatch object contains the results of the match.

This function was introduced in Qt 5.5.

See also QRegularExpressionMatch and normal matching.

source

pub unsafe fn match_q_string_int_match_type( &self, subject: impl CastInto<Ref<QString>>, offset: c_int, match_type: MatchType ) -> CppBox<QRegularExpressionMatch>

Attempts to match the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

Calls C++ function: QRegularExpressionMatch QRegularExpression::match(const QString& subject, int offset = …, QRegularExpression::MatchType matchType = …) const.

C++ documentation:

Attempts to match the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatch object contains the results of the match.

See also QRegularExpressionMatch and normal matching.

source

pub unsafe fn match_q_string_int( &self, subject: impl CastInto<Ref<QString>>, offset: c_int ) -> CppBox<QRegularExpressionMatch>

Attempts to match the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

Calls C++ function: QRegularExpressionMatch QRegularExpression::match(const QString& subject, int offset = …) const.

C++ documentation:

Attempts to match the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatch object contains the results of the match.

See also QRegularExpressionMatch and normal matching.

source

pub unsafe fn match_q_string( &self, subject: impl CastInto<Ref<QString>> ) -> CppBox<QRegularExpressionMatch>

Attempts to match the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

Calls C++ function: QRegularExpressionMatch QRegularExpression::match(const QString& subject) const.

C++ documentation:

Attempts to match the regular expression against the given subject string, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatch object contains the results of the match.

See also QRegularExpressionMatch and normal matching.

source

pub unsafe fn match_q_string_ref_int_match_type( &self, subject_ref: impl CastInto<Ref<QStringRef>>, offset: c_int, match_type: MatchType ) -> CppBox<QRegularExpressionMatch>

This is an overloaded function.

Calls C++ function: QRegularExpressionMatch QRegularExpression::match(const QStringRef& subjectRef, int offset = …, QRegularExpression::MatchType matchType = …) const.

C++ documentation:

This is an overloaded function.

Attempts to match the regular expression against the given subjectRef string reference, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatch object contains the results of the match.

This function was introduced in Qt 5.5.

See also QRegularExpressionMatch and normal matching.

source

pub unsafe fn match_q_string_ref_int( &self, subject_ref: impl CastInto<Ref<QStringRef>>, offset: c_int ) -> CppBox<QRegularExpressionMatch>

This is an overloaded function.

Calls C++ function: QRegularExpressionMatch QRegularExpression::match(const QStringRef& subjectRef, int offset = …) const.

C++ documentation:

This is an overloaded function.

Attempts to match the regular expression against the given subjectRef string reference, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatch object contains the results of the match.

This function was introduced in Qt 5.5.

See also QRegularExpressionMatch and normal matching.

source

pub unsafe fn match_q_string_ref( &self, subject_ref: impl CastInto<Ref<QStringRef>> ) -> CppBox<QRegularExpressionMatch>

This is an overloaded function.

Calls C++ function: QRegularExpressionMatch QRegularExpression::match(const QStringRef& subjectRef) const.

C++ documentation:

This is an overloaded function.

Attempts to match the regular expression against the given subjectRef string reference, starting at the position offset inside the subject, using a match of type matchType and honoring the given matchOptions.

The returned QRegularExpressionMatch object contains the results of the match.

This function was introduced in Qt 5.5.

See also QRegularExpressionMatch and normal matching.

source

pub unsafe fn named_capture_groups(&self) -> CppBox<QStringList>

Returns a list of captureCount() + 1 elements, containing the names of the named capturing groups in the pattern string. The list is sorted such that the element of the list at position i is the name of the i-th capturing group, if it has a name, or an empty string if that capturing group is unnamed.

Calls C++ function: QStringList QRegularExpression::namedCaptureGroups() const.

C++ documentation:

Returns a list of captureCount() + 1 elements, containing the names of the named capturing groups in the pattern string. The list is sorted such that the element of the list at position i is the name of the i-th capturing group, if it has a name, or an empty string if that capturing group is unnamed.

For instance, given the regular expression

(?<day>\d\d)-(?<month>\d\d)-(?<year>\d\d\d\d) (\w+) (?<name>\w+)

namedCaptureGroups() will return the following list:

(“”, “day”, “month”, “year”, “”, “name”)

which corresponds to the fact that the capturing group #0 (corresponding to the whole match) has no name, the capturing group #1 has name "day", the capturing group #2 has name "month", etc.

If the regular expression is not valid, returns an empty list.

This function was introduced in Qt 5.1.

See also isValid(), QRegularExpressionMatch::captured(), and QString::isEmpty().

source

pub unsafe fn new_0a() -> CppBox<QRegularExpression>

Constructs a QRegularExpression object with an empty pattern and no pattern options.

Calls C++ function: [constructor] void QRegularExpression::QRegularExpression().

C++ documentation:

Constructs a QRegularExpression object with an empty pattern and no pattern options.

See also setPattern() and setPatternOptions().

source

pub unsafe fn new_2a( pattern: impl CastInto<Ref<QString>>, options: QFlags<PatternOption> ) -> CppBox<QRegularExpression>

Constructs a QRegularExpression object using the given pattern as pattern and the options as the pattern options.

Calls C++ function: [constructor] void QRegularExpression::QRegularExpression(const QString& pattern, QFlags<QRegularExpression::PatternOption> options = …).

C++ documentation:

Constructs a QRegularExpression object using the given pattern as pattern and the options as the pattern options.

See also setPattern() and setPatternOptions().

source

pub unsafe fn new_1a( pattern: impl CastInto<Ref<QString>> ) -> CppBox<QRegularExpression>

Constructs a QRegularExpression object using the given pattern as pattern and the options as the pattern options.

Calls C++ function: [constructor] void QRegularExpression::QRegularExpression(const QString& pattern).

C++ documentation:

Constructs a QRegularExpression object using the given pattern as pattern and the options as the pattern options.

See also setPattern() and setPatternOptions().

source

pub unsafe fn new_copy( re: impl CastInto<Ref<QRegularExpression>> ) -> CppBox<QRegularExpression>

Constructs a QRegularExpression object as a copy of re.

Calls C++ function: [constructor] void QRegularExpression::QRegularExpression(const QRegularExpression& re).

C++ documentation:

Constructs a QRegularExpression object as a copy of re.

See also operator=().

source

pub unsafe fn optimize(&self)

Forces an immediate optimization of the pattern, including JIT-compiling it (if the JIT compiler is enabled).

Calls C++ function: void QRegularExpression::optimize() const.

C++ documentation:

Forces an immediate optimization of the pattern, including JIT-compiling it (if the JIT compiler is enabled).

Patterns are normally optimized only after a certain number of usages. If you can predict that this QRegularExpression object is going to be used for several matches, it may be convenient to optimize it in advance by calling this function.

This function was introduced in Qt 5.4.

See also QRegularExpression::OptimizeOnFirstUsageOption.

source

pub unsafe fn pattern(&self) -> CppBox<QString>

Returns the pattern string of the regular expression.

Calls C++ function: QString QRegularExpression::pattern() const.

C++ documentation:

Returns the pattern string of the regular expression.

See also setPattern() and patternOptions().

source

pub unsafe fn pattern_error_offset(&self) -> c_int

Returns the offset, inside the pattern string, at which an error was found when checking the validity of the regular expression. If no error was found, then -1 is returned.

Calls C++ function: int QRegularExpression::patternErrorOffset() const.

C++ documentation:

Returns the offset, inside the pattern string, at which an error was found when checking the validity of the regular expression. If no error was found, then -1 is returned.

See also pattern(), isValid(), and errorString().

source

pub unsafe fn pattern_options(&self) -> QFlags<PatternOption>

Returns the pattern options for the regular expression.

Calls C++ function: QFlags<QRegularExpression::PatternOption> QRegularExpression::patternOptions() const.

C++ documentation:

Returns the pattern options for the regular expression.

See also setPatternOptions() and pattern().

source

pub unsafe fn set_pattern(&self, pattern: impl CastInto<Ref<QString>>)

Sets the pattern string of the regular expression to pattern. The pattern options are left unchanged.

Calls C++ function: void QRegularExpression::setPattern(const QString& pattern).

C++ documentation:

Sets the pattern string of the regular expression to pattern. The pattern options are left unchanged.

See also pattern() and setPatternOptions().

source

pub unsafe fn set_pattern_options(&self, options: QFlags<PatternOption>)

Sets the given options as the pattern options of the regular expression. The pattern string is left unchanged.

Calls C++ function: void QRegularExpression::setPatternOptions(QFlags<QRegularExpression::PatternOption> options).

C++ documentation:

Sets the given options as the pattern options of the regular expression. The pattern string is left unchanged.

See also patternOptions() and setPattern().

source

pub unsafe fn swap(&self, other: impl CastInto<Ref<QRegularExpression>>)

Swaps the regular expression other with this regular expression. This operation is very fast and never fails.

Calls C++ function: void QRegularExpression::swap(QRegularExpression& other).

C++ documentation:

Swaps the regular expression other with this regular expression. This operation is very fast and never fails.

source

pub unsafe fn wildcard_to_regular_expression( str: impl CastInto<Ref<QString>> ) -> CppBox<QString>

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns a regular expression representation of the given glob pattern. The transformation is targeting file path globbing, which means in particular that path separators receive special treatment. This implies that it is not just a basic translation from "*" to ".*".

Calls C++ function: static QString QRegularExpression::wildcardToRegularExpression(const QString& str).

C++ documentation:

Returns a regular expression representation of the given glob pattern. The transformation is targeting file path globbing, which means in particular that path separators receive special treatment. This implies that it is not just a basic translation from “” to “.”.


  QString wildcard = QRegularExpression::wildcardToRegularExpression("*.jpeg");
  // Will match files with names like:
  //    foo.jpeg
  //    f_o_o.jpeg
  //    föö.jpeg

Warning: Unlike QRegExp, this implementation follows closely the definition of wildcard for glob patterns:

cAny character represents itself apart from those mentioned below. Thus c matches the character c.
?Matches any single character. It is the same as . in full regexps.
*Matches zero or more of any characters. It is the same as .* in full regexps.
[abc]Matches one character given in the bracket.
[a-c]Matches one character from the range given in the bracket.
[!abc]Matches one character that is not given in the bracket. It is the same as [^abc] in full regexp.
[!a-c]Matches one character that is not from the range given in the bracket. It is the same as [^a-c] in full regexp.

Note: The backslash (\) character is not an escape char in this context. In order to match one of the special characters, place it in square brackets (for example, "[?]").

More information about the implementation can be found in:

This function was introduced in Qt 5.12.

See also escape().

Trait Implementations§

source§

impl CppDeletable for QRegularExpression

source§

unsafe fn delete(&self)

Destroys the QRegularExpression object.

Calls C++ function: [destructor] void QRegularExpression::~QRegularExpression().

C++ documentation:

Destroys the QRegularExpression object.

source§

impl PartialEq<Ref<QRegularExpression>> for QRegularExpression

source§

fn eq(&self, re: &Ref<QRegularExpression>) -> bool

Returns true if the regular expression is equal to re, or false otherwise. Two QRegularExpression objects are equal if they have the same pattern string and the same pattern options.

Calls C++ function: bool QRegularExpression::operator==(const QRegularExpression& re) const.

C++ documentation:

Returns true if the regular expression is equal to re, or false otherwise. Two QRegularExpression objects are equal if they have the same pattern string and the same pattern options.

See also operator!=().

1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

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, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

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

§

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>,

§

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.