pub enum StartFrom {
Pattern {
pattern: NamePattern,
strict: bool,
},
Attribute(String),
Pub,
GlobalCtors,
}Expand description
Predicates that determine wihch items to use as starting point for translation.
Variants§
Pattern
Item identified by a pattern/path. If strict is true, then failing to find an item matching the pattern is an error; otherwise, we just ignore this pattern.
Attribute(String)
Item annotated with the given attribute.
Pub
Item marked pub. Note that this does not take accessibility into account; a
non-reexported pub item will be included here.
GlobalCtors
The global constructors of the target.
Implementations§
Source§impl StartFrom
impl StartFrom
Sourcepub fn is_pattern(&self) -> bool
pub fn is_pattern(&self) -> bool
Returns true if this is a StartFrom::Pattern, otherwise false
Sourcepub fn as_pattern_mut(&mut self) -> Option<(&mut NamePattern, &mut bool)>
pub fn as_pattern_mut(&mut self) -> Option<(&mut NamePattern, &mut bool)>
Optionally returns mutable references to the inner fields if this is a StartFrom::Pattern, otherwise None
Sourcepub fn as_pattern(&self) -> Option<(&NamePattern, &bool)>
pub fn as_pattern(&self) -> Option<(&NamePattern, &bool)>
Optionally returns references to the inner fields if this is a StartFrom::Pattern, otherwise None
Sourcepub fn into_pattern(self) -> Result<(NamePattern, bool), Self>
pub fn into_pattern(self) -> Result<(NamePattern, bool), Self>
Returns the inner fields if this is a StartFrom::Pattern, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_pattern_unchecked(self) -> (NamePattern, bool)
pub unsafe fn into_pattern_unchecked(self) -> (NamePattern, bool)
Unchecked return of the inner fields of StartFrom::Pattern.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_pattern_unchecked(&self) -> (&NamePattern, &bool)
pub unsafe fn as_pattern_unchecked(&self) -> (&NamePattern, &bool)
Unchecked reference of the inner fields of StartFrom::Pattern.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_pattern_mut_unchecked(
&mut self,
) -> (&mut NamePattern, &mut bool)
pub unsafe fn as_pattern_mut_unchecked( &mut self, ) -> (&mut NamePattern, &mut bool)
Unchecked mutable reference of the inner fields of StartFrom::Pattern.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_attribute(&self) -> bool
pub fn is_attribute(&self) -> bool
Returns true if this is a StartFrom::Attribute, otherwise false
Sourcepub fn as_attribute_mut(&mut self) -> Option<&mut String>
pub fn as_attribute_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a StartFrom::Attribute, otherwise None
Sourcepub fn as_attribute(&self) -> Option<&String>
pub fn as_attribute(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a StartFrom::Attribute, otherwise None
Sourcepub fn into_attribute(self) -> Result<String, Self>
pub fn into_attribute(self) -> Result<String, Self>
Returns the inner fields if this is a StartFrom::Attribute, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_attribute_unchecked(self) -> String
pub unsafe fn into_attribute_unchecked(self) -> String
Unchecked return of the inner fields of StartFrom::Attribute.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_attribute_unchecked(&self) -> &String
pub unsafe fn as_attribute_unchecked(&self) -> &String
Unchecked reference of the inner fields of StartFrom::Attribute.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_attribute_mut_unchecked(&mut self) -> &mut String
pub unsafe fn as_attribute_mut_unchecked(&mut self) -> &mut String
Unchecked mutable reference of the inner fields of StartFrom::Attribute.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_global_ctors(&self) -> bool
pub fn is_global_ctors(&self) -> bool
Returns true if this is a StartFrom::GlobalCtors, otherwise false
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StartFrom
impl RefUnwindSafe for StartFrom
impl Send for StartFrom
impl Sync for StartFrom
impl Unpin for StartFrom
impl UnsafeUnpin for StartFrom
impl UnwindSafe for StartFrom
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more