#[non_exhaustive]pub enum TransactionType {
Buy,
Sell,
Award,
Exercise,
Gift,
Conversion,
Other(OtherTransactionType),
}Expand description
Transaction types for insider activities with canonical variants and extensible fallback.
This enum provides type-safe handling of transaction types while gracefully
handling unknown or provider-specific transaction types through the Other variant.
Canonical/serde rules:
- Emission uses a single canonical form per variant (UPPERCASE ASCII, no spaces)
- Parser accepts a superset of tokens (aliases, case-insensitive)
Other(s)serializes to its canonicalcode()string (no escape prefix)Displayoutput matches the canonical code for known variants and the rawsforOther(s)- Serde round-trips preserve identity for canonical variants; unknown tokens normalize to
Other(UPPERCASE)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Buy
Purchase or acquisition of shares
Sell
Sale or disposal of shares
Award
Stock award or grant
Exercise
Exercise of options
Gift
Gift of shares
Conversion
Conversion of securities
Other(OtherTransactionType)
Unknown or provider-specific transaction type
Implementations§
Source§impl TransactionType
impl TransactionType
Sourcepub fn try_from_str(input: &str) -> Result<TransactionType, FundamentalsError>
pub fn try_from_str(input: &str) -> Result<TransactionType, FundamentalsError>
Attempts to parse a transaction type, uppercasing unknown inputs into Other.
§Errors
Returns FundamentalsError::InvalidEnumValue when input is empty/whitespace.
Sourcepub fn other(input: &str) -> Result<TransactionType, FundamentalsError>
pub fn other(input: &str) -> Result<TransactionType, FundamentalsError>
Builds an unknown transaction type, rejecting modeled types and aliases.
§Errors
Returns an error if input is empty, cannot be canonicalized, or parses
to a modeled TransactionType variant.
Source§impl TransactionType
impl TransactionType
Sourcepub const fn is_canonical(&self) -> bool
pub const fn is_canonical(&self) -> bool
Returns true when this value represents a canonical variant.
Trait Implementations§
Source§impl AsRef<str> for TransactionType
impl AsRef<str> for TransactionType
Source§impl Clone for TransactionType
impl Clone for TransactionType
Source§fn clone(&self) -> TransactionType
fn clone(&self) -> TransactionType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransactionType
impl Debug for TransactionType
Source§impl<'de> Deserialize<'de> for TransactionType
impl<'de> Deserialize<'de> for TransactionType
Source§fn deserialize<D>(
deserializer: D,
) -> Result<TransactionType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<TransactionType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for TransactionType
impl Display for TransactionType
impl Eq for TransactionType
Source§impl FromStr for TransactionType
impl FromStr for TransactionType
Source§type Err = FundamentalsError
type Err = FundamentalsError
Source§fn from_str(
input: &str,
) -> Result<TransactionType, <TransactionType as FromStr>::Err>
fn from_str( input: &str, ) -> Result<TransactionType, <TransactionType as FromStr>::Err>
s to return a value of this type. Read moreSource§impl Hash for TransactionType
impl Hash for TransactionType
Source§impl PartialEq for TransactionType
impl PartialEq for TransactionType
Source§impl Serialize for TransactionType
impl Serialize for TransactionType
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl StringCode for TransactionType
impl StringCode for TransactionType
impl StructuralPartialEq for TransactionType
Source§impl TryFrom<String> for TransactionType
impl TryFrom<String> for TransactionType
Source§type Error = FundamentalsError
type Error = FundamentalsError
Source§fn try_from(
value: String,
) -> Result<TransactionType, <TransactionType as TryFrom<String>>::Error>
fn try_from( value: String, ) -> Result<TransactionType, <TransactionType as TryFrom<String>>::Error>
Auto Trait Implementations§
impl Freeze for TransactionType
impl RefUnwindSafe for TransactionType
impl Send for TransactionType
impl Sync for TransactionType
impl Unpin for TransactionType
impl UnsafeUnpin for TransactionType
impl UnwindSafe for TransactionType
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
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<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.