pub fn tokens(v: impl Value) -> Vec<Token> {
        OwnedValue::collect(v)
            .tokens()
            .unwrap()
            .iter()
            .filter_map(|token| match token.kind {
                TokenKind::MapBegin(len) => Some(Token::MapBegin(len)),
                TokenKind::MapEnd => Some(Token::MapEnd),
                TokenKind::SeqBegin(len) => Some(Token::SeqBegin(len)),
                TokenKind::SeqEnd => Some(Token::SeqEnd),
                TokenKind::Signed(v) => Some(Token::Signed(v)),
                TokenKind::Unsigned(v) => Some(Token::Unsigned(v)),
                TokenKind::BigSigned(v) => Some(Token::BigSigned(v)),
                TokenKind::BigUnsigned(v) => Some(Token::BigUnsigned(v)),
                TokenKind::Float(v) => Some(Token::Float(v)),
                TokenKind::Bool(v) => Some(Token::Bool(v)),
                TokenKind::Char(v) => Some(Token::Char(v)),
                TokenKind::Str(ref v) => Some(Token::Str((**v).into())),
                TokenKind::None => Some(Token::None),
                TokenKind::Error(ref err) => Some(Token::Error(Source((**err).clone()))),
                _ => None,
            })
            .collect()
    }
/**
    Collect a value into a sequence of tokens.
    */
Collect a value into a sequence of tokens.
Collect a value into a sequence of tokens .
pub fn tokens(v: impl Value) -> Vec<Token> {
        OwnedValue::collect(v)
            .tokens()
            .unwrap()
            .iter()
            .filter_map(|token| match token.kind {
                TokenKind::MapBegin(len) => Some(Token::MapBegin(len)),
                TokenKind::MapEnd => Some(Token::MapEnd),
                TokenKind::SeqBegin(len) => Some(Token::SeqBegin(len)),
                TokenKind::SeqEnd => Some(Token::SeqEnd),
                TokenKind::Signed(v) => Some(Token::Signed(v)),
                TokenKind::Unsigned(v) => Some(Token::Unsigned(v)),
                TokenKind::BigSigned(v) => Some(Token::BigSigned(v)),
                TokenKind::BigUnsigned(v) => Some(Token::BigUnsigned(v)),
                TokenKind::Float(v) => Some(Token::Float(v)),
                TokenKind::Bool(v) => Some(Token::Bool(v)),
                TokenKind::Char(v) => Some(Token::Char(v)),
                TokenKind::Str(ref v) => Some(Token::Str((**v).into())),
                TokenKind::None => Some(Token::None),
                TokenKind::Error(ref err) => Some(Token::Error(Source((**err).clone()))),
                _ => None,
            })
            .collect()
    }
pub fn tokens ( v : impl Value ) -> Vec < Token > { OwnedValue :: collect ( v ) . tokens ( ) . unwrap ( ) . iter ( ) . filter_map ( | token | match token . kind { TokenKind :: MapBegin ( len ) => Some ( Token :: MapBegin ( len ) ) , TokenKind :: MapEnd => Some ( Token :: MapEnd ) , TokenKind :: SeqBegin ( len ) => Some ( Token :: SeqBegin ( len ) ) , TokenKind :: SeqEnd => Some ( Token :: SeqEnd ) , TokenKind :: Signed ( v ) => Some ( Token :: Signed ( v ) ) , TokenKind :: Unsigned ( v ) => Some ( Token :: Unsigned ( v ) ) , TokenKind :: BigSigned ( v ) => Some ( Token :: BigSigned ( v ) ) , TokenKind :: BigUnsigned ( v ) => Some ( Token :: BigUnsigned ( v ) ) , TokenKind :: Float ( v ) => Some ( Token :: Float ( v ) ) , TokenKind :: Bool ( v ) => Some ( Token :: Bool ( v ) ) , TokenKind :: Char ( v ) => Some ( Token :: Char ( v ) ) , TokenKind :: Str ( ref v ) => Some ( Token :: Str ( ( * * v ) . into ( ) ) ) , TokenKind :: None => Some ( Token :: None ) , TokenKind :: Error ( ref err ) => Some ( Token :: Error ( Source ( ( * * err ) . clone ( ) ) ) ) , _ => None , } ) . collect ( ) }
Collect a value into a sequence of tokens.
Collect a value into a sequence of tokens .
v
impl Value