pub struct Scopes(<Scopes as PublicFlags>::Internal);
Expand description
This type represents our knowledge about the set of scope types that a script value can have. In most cases it’s narrowed down to a single scope type, but not always.
The available scope types depend on the game.
They are listed in event_scopes.log
from the game data dumps.
Tuple Fields§
§0: <Scopes as PublicFlags>::Internal
Implementations§
Source§impl Scopes
impl Scopes
pub const None: Self
pub const Value: Self
pub const Bool: Self
pub const Flag: Self
pub const Color: Self
pub const Country: Self
pub const Character: Self
pub const Culture: Self
pub const Province: Self
pub const Pop: Self
pub const Party: Self
pub const Religion: Self
pub const State: Self
pub const War: Self
pub const Accolade: Self
pub const AccoladeType: Self
pub const Activity: Self
pub const ActivityType: Self
pub const Army: Self
pub const Artifact: Self
pub const CasusBelli: Self
pub const CharacterMemory: Self
pub const Combat: Self
pub const CombatSide: Self
pub const CouncilTask: Self
pub const CulturePillar: Self
pub const CultureTradition: Self
pub const Decision: Self
pub const Doctrine: Self
pub const Dynasty: Self
pub const DynastyHouse: Self
pub const Faction: Self
pub const Faith: Self
pub const GovernmentType: Self
pub const GreatHolyWar: Self
pub const HolyOrder: Self
pub const Inspiration: Self
pub const LandedTitle: Self
pub const MercenaryCompany: Self
pub const Scheme: Self
pub const Secret: Self
pub const StoryCycle: Self
pub const Struggle: Self
pub const TitleAndVassalChange: Self
pub const Trait: Self
pub const TravelPlan: Self
pub const VassalContract: Self
pub const VassalObligationLevel: Self
pub const HoldingType: Self
pub const TaxSlot: Self
pub const EpidemicType: Self
pub const Epidemic: Self
pub const LegendType: Self
pub const Legend: Self
pub const GeographicalRegion: Self
pub const Domicile: Self
pub const AgentSlot: Self
pub const TaskContract: Self
pub const TaskContractType: Self
pub const Regiment: Self
pub const CasusBelliType: Self
pub const Battle: Self
pub const BattleSide: Self
pub const Building: Self
pub const BuildingType: Self
pub const CanalType: Self
pub const CivilWar: Self
pub const CulturalCommunity: Self
pub const NewCombatUnit: Self
pub const CommanderOrderType: Self
pub const CountryCreation: Self
pub const CountryDefinition: Self
pub const CountryFormation: Self
pub const Decree: Self
pub const DiplomaticAction: Self
pub const DiplomaticPact: Self
pub const DiplomaticPlay: Self
pub const DiplomaticRelations: Self
pub const Front: Self
pub const Goods: Self
pub const Hq: Self
pub const Ideology: Self
pub const Institution: Self
pub const InstitutionType: Self
pub const InterestMarker: Self
pub const InterestGroup: Self
pub const InterestGroupTrait: Self
pub const InterestGroupType: Self
pub const JournalEntry: Self
pub const Law: Self
pub const LawType: Self
pub const Market: Self
pub const MarketGoods: Self
pub const Objective: Self
pub const PoliticalMovement: Self
pub const PopType: Self
pub const ShippingLane: Self
pub const StateRegion: Self
pub const StateTrait: Self
pub const StrategicRegion: Self
pub const Technology: Self
pub const TechnologyStatus: Self
pub const Theater: Self
pub const TradeRoute: Self
pub const CombatUnitType: Self
pub const MilitaryFormation: Self
pub const Sway: Self
pub const StateGoods: Self
pub const DiplomaticDemand: Self
pub const Company: Self
pub const CompanyType: Self
pub const TravelNode: Self
pub const TravelNodeDefinition: Self
pub const TravelConnection: Self
pub const TravelConnectionDefinition: Self
pub const MobilizationOption: Self
pub const PowerBlocPrincipleGroup: Self
pub const DiplomaticPlayType: Self
pub const DiplomaticCatalyst: Self
pub const DiplomaticCatalystType: Self
pub const DiplomaticCatalystCategory: Self
pub const PoliticalLobby: Self
pub const PoliticalLobbyType: Self
pub const PoliticalLobbyAppeasement: Self
pub const PowerBloc: Self
pub const PowerBlocIdentity: Self
pub const PowerBlocPrinciple: Self
pub const HarvestCondition: Self
pub const PoliticalMovementType: Self
pub const HarvestConditionType: Self
pub const Area: Self
pub const CountryCulture: Self
pub const CultureGroup: Self
pub const Deity: Self
pub const Family: Self
pub const Governorship: Self
pub const GreatWork: Self
pub const Job: Self
pub const Legion: Self
pub const LevyTemplate: Self
pub const Region: Self
pub const Siege: Self
pub const SubUnit: Self
pub const Treasure: Self
pub const Unit: Self
Source§impl Scopes
impl Scopes
Sourcepub const fn bits(&self) -> u128
pub const fn bits(&self) -> u128
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u128) -> Option<Self>
pub const fn from_bits(bits: u128) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u128) -> Self
pub const fn from_bits_truncate(bits: u128) -> Self
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u128) -> Self
pub const fn from_bits_retain(bits: u128) -> Self
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
Sourcepub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!
) of the bits in a flags value, truncating the result.
Source§impl Scopes
impl Scopes
Sourcepub const fn iter(&self) -> Iter<Scopes>
pub const fn iter(&self) -> Iter<Scopes>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<Scopes>
pub const fn iter_names(&self) -> IterNames<Scopes>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Source§impl Scopes
impl Scopes
pub const fn non_primitive() -> Scopes
pub const fn primitive() -> Scopes
pub const fn all_but_none() -> Scopes
Sourcepub fn from_snake_case(s: &str) -> Option<Scopes>
pub fn from_snake_case(s: &str) -> Option<Scopes>
Read a scope type in string form and return it as a Scopes
value.
Sourcepub fn from_snake_case_multi(s: &str) -> Option<Scopes>
pub fn from_snake_case_multi(s: &str) -> Option<Scopes>
Similar to from_snake_case
, but allows multiple scopes separated by |
Returns None if any of the conversions fail.
Trait Implementations§
Source§impl BitAndAssign for Scopes
impl BitAndAssign for Scopes
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&
) of the bits in two flags values.
Source§impl BitOrAssign for Scopes
impl BitOrAssign for Scopes
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
Source§impl BitXorAssign for Scopes
impl BitXorAssign for Scopes
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Source§impl Extend<Scopes> for Scopes
impl Extend<Scopes> for Scopes
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
The bitwise or (|
) of the bits in each flags value.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl Flags for Scopes
impl Flags for Scopes
Source§fn from_bits_retain(bits: u128) -> Scopes
fn from_bits_retain(bits: u128) -> Scopes
§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true
if any unknown bits are set.§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read more§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert
] when value
is true
or [Flags::remove
] when value
is false
.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read more§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.Source§impl From<Scopes> for FieldScopeContext<'_>
impl From<Scopes> for FieldScopeContext<'_>
Source§impl FromIterator<Scopes> for Scopes
impl FromIterator<Scopes> for Scopes
Source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|
) of the bits in each flags value.
Source§impl IntoIterator for Scopes
impl IntoIterator for Scopes
Source§impl Sub for Scopes
impl Sub for Scopes
Source§impl SubAssign for Scopes
impl SubAssign for Scopes
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
impl Copy for Scopes
impl Eq for Scopes
impl StructuralPartialEq for Scopes
Auto Trait Implementations§
impl Freeze for Scopes
impl RefUnwindSafe for Scopes
impl Send for Scopes
impl Sync for Scopes
impl Unpin for Scopes
impl UnwindSafe for Scopes
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> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any
.§impl<T> FmtForward for T
impl<T> FmtForward for T
§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.§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.§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.§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.§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.§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.§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.§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.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§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 more§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 more§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
§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
§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.§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.§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.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§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 more§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 more§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 more§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 more§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 more§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 more§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.§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.§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.§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.§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.§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.§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.