@@ -25,9 +25,9 @@ struct DefaultStyle <: StructStyle end
2525include (" macros.jl" )
2626
2727"""
28- StructUtils.dictlike(x) -> Bool
29- StructUtils.dictlike(::StructStyle, x) -> Bool
30- StructUtils.dictlike(::StructStyle, ::Type{T}) -> Bool
28+ StructUtils.dictlike(x) -> Bool
29+ StructUtils.dictlike(::StructStyle, x) -> Bool
30+ StructUtils.dictlike(::StructStyle, ::Type{T}) -> Bool
3131
3232Returns `true` if `x` or type `T` is dictionary-like, `false` otherwise.
3333When `StructUtils.make(T, source)` is called, if `dictlike(T)` is `true`,
@@ -43,9 +43,9 @@ dictlike(::Type{<:AbstractVector{<:Pair}}) = true
4343dictlike (@nospecialize (T)) = false
4444
4545"""
46- StructUtils.noarg(x) -> Bool
47- StructUtils.noarg(::StructStyle, x) -> Bool
48- StructUtils.noarg(::StructStyle, ::Type{T}) -> Bool
46+ StructUtils.noarg(x) -> Bool
47+ StructUtils.noarg(::StructStyle, x) -> Bool
48+ StructUtils.noarg(::StructStyle, ::Type{T}) -> Bool
4949
5050Signals that `x` or type `T` is a mutable type that can be constructed by calling an empty
5151constructor, like `t = T()`. Automatically overloaded when structs use the
@@ -59,9 +59,9 @@ noarg(::StructStyle, T::Type) = noarg(T)
5959noarg (@nospecialize (T)) = false
6060
6161"""
62- StructUtils.kwarg(x) -> Bool
63- StructUtils.kwarg(::StructStyle, x) -> Bool
64- StructUtils.kwarg(::StructStyle, ::Type{T}) -> Bool
62+ StructUtils.kwarg(x) -> Bool
63+ StructUtils.kwarg(::StructStyle, x) -> Bool
64+ StructUtils.kwarg(::StructStyle, ::Type{T}) -> Bool
6565
6666Signals that `x` or type `T` can be constructed by passing struct fields as keyword arguments
6767to the constructor, like `t = T(field1=a, field2=b, ...)`. Automatically overloaded
@@ -193,9 +193,9 @@ _valtype(d) = valtype(d)
193193_valtype (:: AbstractVector{Pair{A,B}} ) where {A,B} = B
194194
195195"""
196- StructUtils.arraylike(x) -> Bool
197- StructUtils.arraylike(::StructStyle, x) -> Bool
198- StructUtils.arraylike(::StructStyle, ::Type{T}) -> Bool
196+ StructUtils.arraylike(x) -> Bool
197+ StructUtils.arraylike(::StructStyle, x) -> Bool
198+ StructUtils.arraylike(::StructStyle, ::Type{T}) -> Bool
199199
200200Returns `true` if `x` or type `T` is array-like, `false` otherwise. This function is
201201called by `StructUtils.make` to determine if `T` is array-like. The default
@@ -218,9 +218,9 @@ arraylike(::Type{<:Core.SimpleVector}) = true
218218arraylike (@nospecialize (T)) = false
219219
220220"""
221- StructUtils.structlike(x) -> Bool
222- StructUtils.structlike(::StructStyle, x) -> Bool
223- StructUtils.structlike(::StructStyle, ::Type{T}) -> Bool
221+ StructUtils.structlike(x) -> Bool
222+ StructUtils.structlike(::StructStyle, x) -> Bool
223+ StructUtils.structlike(::StructStyle, ::Type{T}) -> Bool
224224
225225Returns `true` if `x` or type `T` is struct-like, `false` otherwise. This function is
226226called by `StructUtils.make` to determine if `T` is struct-like. The default
@@ -256,9 +256,9 @@ structlike(@nospecialize(x)) = structlike(typeof(x))
256256structlike (@nospecialize (T:: Type )) = isstructtype (T) && ! Base. issingletontype (T)
257257
258258"""
259- StructUtils.nulllike(x) -> Bool
260- StructUtils.nulllike(::StructStyle, x) -> Bool
261- StructUtils.nulllike(::StructStyle, ::Type{T}) -> Bool
259+ StructUtils.nulllike(x) -> Bool
260+ StructUtils.nulllike(::StructStyle, x) -> Bool
261+ StructUtils.nulllike(::StructStyle, ::Type{T}) -> Bool
262262
263263Returns `true` if `x` or type `T` is null-like, `false` otherwise. This function is
264264mainly used in the `make!` implementation to determine if a
@@ -271,8 +271,8 @@ nulllike(::StructStyle, T::Type) = nulllike(T)
271271nulllike (@nospecialize (T)) = T === Missing || T === Nothing
272272
273273"""
274- StructUtils.lower(x) -> x
275- StructUtils.lower(::StructStyle, x) -> x
274+ StructUtils.lower(x) -> x
275+ StructUtils.lower(::StructStyle, x) -> x
276276
277277Domain value transformation function. This function is called by
278278`StructUtils.applyeach` on each value in the `source` object before
@@ -297,8 +297,8 @@ function lower(st::StructStyle, x, tags)
297297end
298298
299299"""
300- StructUtils.lowerkey(x) -> x
301- StructUtils.lowerkey(style::StructUtils.StructStyle, x) -> x
300+ StructUtils.lowerkey(x) -> x
301+ StructUtils.lowerkey(style::StructUtils.StructStyle, x) -> x
302302
303303Allows customizing how a value is lowered when used specifically as a key.
304304By default, calls [`StructUtils.lower`](@ref). Called from [`StructUtils.applyeach`](@ref)
@@ -327,8 +327,8 @@ lowerkey(::StructStyle, x) = lowerkey(x)
327327lowerkey (x) = x
328328
329329"""
330- StructUtils.lift(::Type{T}, x) -> T
331- StructUtils.lift(::StructStyle, ::Type{T}, x) -> Tuple{T, Any}
330+ StructUtils.lift(::Type{T}, x) -> T
331+ StructUtils.lift(::StructStyle, ::Type{T}, x) -> Tuple{T, Any}
332332
333333Lifts a value `x` to a type `T`. This function is called by `StructUtils.make`
334334to lift unit/atom values to the appropriate type. The default implementation is
@@ -389,8 +389,8 @@ function lift(st::StructStyle, ::Type{T}, x, tags) where {T}
389389end
390390
391391"""
392- StructUtils.liftkey(::Type{T}, x) -> x
393- StructUtils.liftkey(style::StructStyle, ::Type{T}, x) -> x
392+ StructUtils.liftkey(::Type{T}, x) -> x
393+ StructUtils.liftkey(style::StructStyle, ::Type{T}, x) -> x
394394
395395Allows customizing how a key is lifted before being passed to [`addkeyval!`](@ref)
396396in `dictlike` construction.
@@ -1013,7 +1013,7 @@ end
10131013@doc (@doc make) make!
10141014
10151015"""
1016- StructUtils.reset!(x::T)
1016+ StructUtils.reset!(x::T)
10171017
10181018If `T` was defined with default values via `@defaults`, `@tags`, `@kwarg`, or `@noarg`,
10191019`reset!` will reset the fields of `x` to their default values.
0 commit comments