pub enum CSharpVersion {
Unity,
CSharp9,
CSharp10,
CSharp11,
CSharp12,
}Expand description
Target C# language version — controls which syntax features are used.
Variants§
Unity
Unity C# 9.0 — sealed class + { get; set; }, no records or init-only setters.
CSharp9
C# 9.0 (default) — positional records, block-scoped namespaces.
CSharp10
C# 10.0 — file-scoped namespaces.
CSharp11
C# 11.0 — required modifier, native [JsonPolymorphic].
CSharp12
C# 12.0 — primary constructors.
Implementations§
Source§impl CSharpVersion
impl CSharpVersion
Sourcepub fn supports_file_scoped_namespace(self) -> bool
pub fn supports_file_scoped_namespace(self) -> bool
Whether the target supports file-scoped namespaces (C# 10+, not Unity).
Sourcepub fn supports_required_modifier(self) -> bool
pub fn supports_required_modifier(self) -> bool
Whether the target supports the required modifier (C# 11+, not Unity).
Sourcepub fn uses_records(self) -> bool
pub fn uses_records(self) -> bool
Whether the target uses record types. Unity uses class instead.
Trait Implementations§
Source§impl Clone for CSharpVersion
impl Clone for CSharpVersion
Source§fn clone(&self) -> CSharpVersion
fn clone(&self) -> CSharpVersion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CSharpVersion
impl Debug for CSharpVersion
Source§impl Default for CSharpVersion
impl Default for CSharpVersion
Source§fn default() -> CSharpVersion
fn default() -> CSharpVersion
Returns the “default value” for a type. Read more
Source§impl Display for CSharpVersion
impl Display for CSharpVersion
Source§impl Ord for CSharpVersion
impl Ord for CSharpVersion
Source§fn cmp(&self, other: &CSharpVersion) -> Ordering
fn cmp(&self, other: &CSharpVersion) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CSharpVersion
impl PartialEq for CSharpVersion
Source§impl PartialOrd for CSharpVersion
impl PartialOrd for CSharpVersion
impl Copy for CSharpVersion
impl Eq for CSharpVersion
impl StructuralPartialEq for CSharpVersion
Auto Trait Implementations§
impl Freeze for CSharpVersion
impl RefUnwindSafe for CSharpVersion
impl Send for CSharpVersion
impl Sync for CSharpVersion
impl Unpin for CSharpVersion
impl UnsafeUnpin for CSharpVersion
impl UnwindSafe for CSharpVersion
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
Mutably borrows from an owned value. Read more