StringAccessor

Struct StringAccessor 

Source
pub struct StringAccessor<'a> { /* private fields */ }
Expand description

字符串 Series 的专用操作访问器

提供了专门针对 Series<String> 的字符串处理方法, 包括模式匹配、大小写转换、空白字符处理等功能。

§使用方式

通过 Series<String>.str() 方法获取该访问器实例。

§示例

let s = Series::new("names".to_string(), vec!["Alice", "Bob", "Charlie"]);
let contains_result = s.str().contains("a")?;
let uppercase_result = s.str().to_uppercase()?;

Implementations§

Source§

impl<'a> StringAccessor<'a>

Source

pub fn contains(&self, pattern: &str) -> AxionResult<Series<bool>>

检查元素是否包含指定模式

§参数
  • pattern - 要搜索的字符串模式
§返回值

返回新的布尔类型 Series,null 值保持为 null

Source

pub fn startswith(&self, pattern: &str) -> AxionResult<Series<bool>>

检查元素是否以指定模式开头

§参数
  • pattern - 要检查的前缀模式
§返回值

返回新的布尔类型 Series,null 值保持为 null

Source

pub fn endswith(&self, pattern: &str) -> AxionResult<Series<bool>>

检查元素是否以指定模式结尾

§参数
  • pattern - 要检查的后缀模式
§返回值

返回新的布尔类型 Series,null 值保持为 null

Source

pub fn str_len(&self) -> AxionResult<Series<u32>>

获取每个字符串元素的长度(字节数)

§返回值

返回新的 u32 类型 Series,null 值保持为 null

Source

pub fn replace(&self, from: &str, to: &str) -> AxionResult<Series<String>>

替换所有匹配的模式

§参数
  • from - 要替换的模式
  • to - 替换后的字符串
§返回值

返回新的字符串 Series,null 值保持为 null

Source

pub fn to_lowercase(&self) -> AxionResult<Series<String>>

转换为小写

§返回值

返回新的字符串 Series,所有字符转换为小写,null 值保持为 null

Source

pub fn to_uppercase(&self) -> AxionResult<Series<String>>

转换为大写

§返回值

返回新的字符串 Series,所有字符转换为大写,null 值保持为 null

Source

pub fn strip(&self) -> AxionResult<Series<String>>

去除首尾空白字符

§返回值

返回新的字符串 Series,去除每个字符串的首尾空白字符,null 值保持为 null

Source

pub fn lstrip(&self) -> AxionResult<Series<String>>

去除开头的空白字符

§返回值

返回新的字符串 Series,去除每个字符串开头的空白字符,null 值保持为 null

Source

pub fn rstrip(&self) -> AxionResult<Series<String>>

去除末尾的空白字符

§返回值

返回新的字符串 Series,去除每个字符串末尾的空白字符,null 值保持为 null

Auto Trait Implementations§

§

impl<'a> Freeze for StringAccessor<'a>

§

impl<'a> RefUnwindSafe for StringAccessor<'a>

§

impl<'a> Send for StringAccessor<'a>

§

impl<'a> Sync for StringAccessor<'a>

§

impl<'a> Unpin for StringAccessor<'a>

§

impl<'a> UnwindSafe for StringAccessor<'a>

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

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

Source§

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.